Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: local variable

To   <>
Subject   st: local variable
Date   Tue, 30 Sep 2003 20:06:33 +0530 (IST)

I am tring to use some local varibales in a regreession model.
For example,

su yvar,detail
local a1=r(p1)
local a2=r(p99)
reg yvar xvar if yvar>`a1' & yvar<`a99' *Eq.1

su yvar, detail
reg yvar xvar if yvar>r(p1) & yvar<r(p99) *Eq.2

Now the problem is when I am estimating Eq.1, it uses the criteria
yvar>=`a1'&yvar<=`a99' rather than expected.It uses the 5119 observations,
while it should be 5118.

Eq.2 is not estimated, it gives the error of no observation.
But the

su yvar,detail
su yvar if yvar>r(p1)&yvar<r(p99)

shows that I have 5118 observations.
and su yvar if yvar>`a1' & yvar<`a99' shows that I have 5119 observations.

Is there any problem with declaration of local variable? What are the
otherways in wihich I can restrict my sample to be between 1% and 99% of

-Jayesh Kumar

Research Scholar,
Indira Gandhi Institute Of Development Research (IGIDR),
Gen. Arun Kumar Vaidya Marg,
Santosh Nagar, Goregaon (East), Mumbai-400065, INDIA.
Tel # + 91 (22) 2840 0919/0920/0921  Extn. 591(Office) 263(Residence)
Fax # + 91 (22) 2840 2752/2026
When I don't know what I'm doing I'm doing Research!

*   For searches and help try:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index