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: Collapse and count
From 
 
"Eric M. Uslaner" <[email protected]> 
To 
 
"[email protected]" <[email protected]> 
Subject 
 
Re: st: Collapse and count 
Date 
 
Tue, 19 Nov 2013 19:23:32 +0000 
I want to collapse a data set and obtain N's for each country in the data set.  I have looked at the manual and online help for collapse, groups, etc. and can't find an answer to this question.
Let's say I want variables X1 X2:
Collapse (mean) X1 X2, by(country)  
Gives me what I want except for the N for each country
Collapse (count) X1 X2,by(country)
Just gives me the country Ns without names of countries.
(Sorry for the leading caps, can't get Outlook to use lower case).
What I want is:
Country X1mean X2mean N  where N is for each country
Thanks for any help,
Ric
*
*   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/