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:[email protected]]
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/