Statalist


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

st: Generating Ids in a panel


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: Generating Ids in a panel
Date   Mon, 21 Jan 2008 16:58:55 +0100

I am working on a panel dataset that does not (yet) contain ids and time
variables. Now that I want to xtset it, I am wondering how I can generate a
sequence for the ids that increments after the 7th, 14th... observation? At
the same time, I need to generate the same pattern of years for every
individual, i.e. I want to go from

UNION	ED	BLK	LWAGE
0	9	0	5.56068
0	9	0	5.72031
0	9	0	5.99645
0	9	0	5.99645
0	9	0	6.06146
0	9	0	6.17379
0	9	0	6.24417
0	11	0	6.16331
0	11	0	6.21461
1	11	0	6.2634
0	11	0	6.54391
0	11	0	6.69703
0	11	0	6.79122
0	11	0	6.81564


To 


UNION	ED	BLK	LWAGE	     id    year
0	9	0	5.56068	1	1976
0	9	0	5.72031	1	1977
0	9	0	5.99645	1	1978
0	9	0	5.99645	1	1979
0	9	0	6.06146	1	1980
0	9	0	6.17379	1	1981
0	9	0	6.24417	1	1982
0	11	0	6.16331	2	1976
0	11	0	6.21461	2	1977
1	11	0	6.2634	2	1978
0	11	0	6.54391	2	1979
0	11	0	6.69703	2	1980
0	11	0	6.79122	2	1981
0	11	0	6.81564	2	1982



Is there any utility to do this - I just used Excel which seems a little
weird given that this task seems ubiquitous...


Thanxx in advance, 

Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945


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