Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: using saved values


From   "Lektzian, David" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: RE: using saved values
Date   Tue, 20 Jan 2009 13:37:20 -0600

Thanks to all who responded...very helpful.  I solved my current problem plus more.
Dave

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Tuesday, January 20, 2009 11:36 AM
To: [email protected]
Subject: st: RE: using saved values


Line for the server...

***********
sysuse auto, clear
su pr,d
loc pc75=r(p75)
loc pc25=r(p25)
g biggerthanp75=pr>`pc75'
g smallerthan25=pr<`pc25'
g inbetween=( biggerthanp75==0 &  smallerthan25==0)
sort pr
l price biggerthanp75 smallerthan25 inbetween
***********

HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Lektzian, David
Sent: Tuesday, January 20, 2009 6:29 PM
To: [email protected]
Subject: st: using saved values

Dear Statalist,
I know this is a pretty simple question, but I was wondering if somebody
could tell my how to get the 75th percentile of a variable and then use it
for a future calculation.  So, specifically, using a cross-sectional time
series data set organized by country and year, I want to do the following:
By year, generate a variable with the 75th percentile value for
SqMilesOfLand
Then generate another variable =1 if the current value for a country of
SqMilesOfLand > 75th percentile.
Then I want to do the same thing for less than the 25th percentile, and
another dummy for being between the 25th and 75th percentiles.

A more general question is that I can't figure out how to call out saved
values from something like summarize and use them in future calculations.

Any help/instruction would be greatly appreciated.

Dave



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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