Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: median


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: median
Date   Fri, 11 Aug 2006 09:30:44 -0400

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
michael.blasnik@verizon.net

----- Original Message ----- From: "Monika Huembelin" <hummel29@yahoo.com>
To: <statalist@hsphsun2.harvard.edu>
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/



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