Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: Using the "collapse" command to generate median and range


From   Sarah Sorscher <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Using the "collapse" command to generate median and range
Date   Thu, 15 Nov 2012 12:42:30 -0600

Thanks Rich! 

I appreciate your response: now I realize it was there in the Summary Statistics section of the help manual, staring me right in the face this whole time.

Sarah


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Richard Goldstein
Sent: Thursday, November 15, 2012 12:56 PM
To: [email protected]
Subject: Re: st: Using the "collapse" command to generate median and range

two of the options for the collapse stats are the "min" and the "max"; the difference is the range

Rich

On 11/15/12 12:30 PM, Sarah Sorscher wrote:
> Dear list,
> 
> I am using the "collapse" command to generate summary statistics for my data. The following code gives me median, mean, standard deviation, and number (n) for my variable, *duration*, aggregated by *treatment* and *sickestpt*.
> 
> . collapse (p50) mediandur=duration (mean) meandur= duration (sd) 
> sddur=duration (count) n=duration, by(treatment sickestpt)
> 
> But I can't figure out how to generate a range.
> 
> I haven't been able to find range in the Summary Statistics section of the STATA help manual, and searches churn up too many unrelated uses of the term "range."
> 
> I considered adding the following: 
> (p99) hirangedur=duration (p1) lorangedur=duration
> 
> But this would only get me the 99th and 1st percentile, as opposed to range. 
> 
> Is there any term I could use to collapse for range?
> 
> Sarah
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index