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

RE: st: RE: Generating dummies


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Generating dummies
Date   Tue, 21 Jun 2005 21:14:47 +0100

Now this problem I understand. Without restructuring
your data you can do 

. qui tab state 
. di `r(r)' 

or 

. levelsof state, local(states) 
. di `: list sizeof states' 

Nick 
[email protected] 

Eric G. Wruck
 
> Well, I only count 50 states plus the District of Columbia.  
> You can't go by the number you have next to the state.  
> Numbers 3, 7, & 15, for example, are all missing.  To see how 
> many unique states you have, you could do something like:
> 
> sort state
> 
> by state: keep if _n == 1
> 
> tab state
> 
> 
> 
> >ALABAMA 	1
> >WEST VIRGINIA 	54
> >WISCONSIN 	55
> >WYOMING 	56

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