Monika--
To Michael's code, I would add the precaution
sum myvar, detail
gen byte above=myvar>r(p50) if !mi(myvar)
tab mycohort above, mi
On 8/11/06, Monika Huembelin <[email protected]> wrote:
Thank you. Exactly what I have been looking for. Of course there's nothing wrong with calculating the median. But I was looking for a way where I wouldn't have to change he median value in my calculation anytime I change something in my database. As a stata beginner I'm not really accustomed with every basic trick. Thanks a lot.
Monika
----- Urspr�ngliche Mail ----
Von: Michael Blasnik <[email protected]>
An: [email protected]
Gesendet: Freitag, den 11. August 2006, 15:30:44 Uhr
Betreff: st: Re: median
You want to know how many values are above the median, but you don't want to
have to calculate the median? Why? What's wrong with this?
sum myvar, detail
gen byte above=myvar>r(p50)
tab mycohort above
Michael Blasnik
[email protected]
----- Original Message -----
From: "Monika Huembelin" <[email protected]>
To: <[email protected]>
Sent: Friday, August 11, 2006 9:07 AM
Subject: st: median
> I'd like to calculate how many observations in each cohort are above the
> total median value of a variable. Does anyone know if there is an easy way
> to do that without having to calculate the median first and include the
> value in each following calculation? I couldn't find anything in the help
> files. Thank you
>
> Monika
*
* 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/
*
* 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/
*
* 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/