Hi!
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
yvar?
TIA,
-Jayesh Kumar
************************************************************************
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
visit: www.igidr.ac.in/~jayesh
************************************************************************
When I don't know what I'm doing I'm doing Research!
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/