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

st: RE: creating a dummy


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: creating a dummy
Date   Wed, 25 Feb 2004 16:55:52 -0000

sounds like 

bysort id : gen byte repeats = _N > 1 

Nick
n.j.cox@durham.ac.uk 

Tumur Gunchinmaa

My data is in a long format. I would like to create a dummy which 
count the i (unique value variable). Basically, dum=1 if i is 
specified more than once. 
For example, 
id year inc 
1 80 5000 
1 81 5500 
1 82 6000 
2 81 5000 
3 81 6500 
3 82 7000 

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