Statalist The Stata Listserver


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

st: RE: Save results as a data file


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: Save results as a data file
Date   Fri, 15 Sep 2006 22:38:37 +0200

Sorry, I think I misunderstood your question. If I interpret your question correctly,
you actually want to know how many times a certain values occur. That can be 
obtained with the following example code:

*---------begin example------
sysuse auto, clear
bys rep78: gen N = _N
bys rep78: keep if _n==1
keep rep78 N
list
*---------end example-------

HTH,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Fan, Shihe
Sent: vrijdag 15 september 2006 22:16
To: [email protected]
Subject: st: Save results as a data file

Say, I have  a variable (x) with many levels in a file. I want to get
the total count of each level in a file.

 

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index