Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: How to do percentage analysis


From   "Nichols, Austin" <ANichols@ui.urban.org>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to do percentage analysis
Date   Tue, 24 Aug 2004 13:48:27 -0400

See help on -egen- or try

egen double x75=pctile(x), p(75) by(group)
bysort group: su x if x>=x75, d
egen double x25=pctile(x), p(25) by(group)
bysort group: su x if x<=x25, d

-----Original Message-----
From: Maoyong Fan [mailto:fan@berkeley.edu]
Sent: Tuesday, August 24, 2004 1:37 PM
To: statalist
Subject: st: How to do percentage analysis


Dear Friends,

	I have a dataset like this:

hhid	group     
104	       0  
201	       0  
108	       0  
107	       0  
103	       1  
109	       1  
106	       1  
105	       1  
102	       1  

For each group (0 and 1), I want to get the mean/median/s.d. of top 25
quantile obs and mean/median/s.d. of bottom 25 quantile obs.   

How could I do this in Stata?
	

Warm regards,

Maoyong				

   



*
*   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/



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