Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: partial label list


From   "Benhoen2" <benhoen2@earthlink.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: partial label list
Date   Wed, 29 Sep 2010 10:44:13 -0400

Stata-sticions,

I have a string variable ("namestr") that was used to create a integer
variable ("name").  My dataset has 5000 cases each with a "name" identified.
The variable "name" has 1,200 unique values and accompanying labels.  I
created a new variable which stored the rowwise count of each of the names
across the dataset ("cname").

Code: 
encode namestr, gen(name)
bys name: egen cname = count(name)
label variable cname "count of cases per name"

For purposes of display I want to list the name, label, and count for only a
subset of the list of names (e.g., if cname>5).  I tried playing around with
"label list" and "tab1" but couldn't find the perfect combo to show me
everything I wanted.  Any advice?

Thanks, as always,

Ben


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index