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

From |
"Michael Blasnik" <michael.blasnik@verizon.net> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: numbering observations |

Date |
Wed, 21 Sep 2005 15:51:08 -0400 |

bysort person date: gen jobs=_n

Michael Blasnik

michael.blasnik@verizon.net

----- Original Message ----- From: "daphna" <dbassok@stanford.edu>

To: <statalist@hsphsun2.harvard.edu>

Sent: Wednesday, September 21, 2005 3:45 PM

Subject: st: numbering observations

I have a very basic question, so I am sorry to bother the list members if this is too obvious.

I have observations about people at 24 time points and oftentimes I have more than 1 observation per time period. The data is about earnings, so for instance, if a person had two jobs in june 1996, i have two observations for them then. If they had 3 jobs in october 1996, I would have 3 observations for that time period- one observation per job.

For now, all I would like to do it create a new variable "jobs" which arbitrarily assigns a number to each job within a time period. (ie. 1 for the first job in 6/96, 2 for the second, 1 for the first job in 10/96... etc)

(eventually i will use this variable to reshape the data)

I hope my question makes sense. I can't seem to find a command that will do this, but I may have just missed it.

Thanks for any advice,

Daphna

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

**References**:**st: numbering observations***From:*daphna <dbassok@stanford.edu>

- Prev by Date:
**st: RE: xtmixed broken in Stata 9.1?** - Next by Date:
**st: RE: numbering observations** - Previous by thread:
**st: numbering observations** - Next by thread:
**st: xtmixed broken in Stata 9.1?** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |