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

st: new spell variable


From   "Andrea Schaefer" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: new spell variable
Date   Wed, 19 Feb 2003 16:31:18 +0100

Hello, 

I am trying to insert a new variable into the existing data file.
Which looks like this:

t0	t1	id	seqvar	fam95	fam96	fam97	fam98	dur 
34	35	1	1	1	1	1	0	1
0	2	2	1	1	1	0	0	3	
0	2	2	2	1	1 	0	0	3
0	2	2	3	1	1	0	0	3
56	58	3	1	0	0	0	1	3
56	58	3	2	0	0	0	1	3
56	58	3	3	0	0	0	1	3

I want to generate a new variable that marks the spells belonging to a
certain period, like this (year):

t0	t1	id	seqvar	fam95	fam96	fam97	fam98	dur year
34	35	1	1	1	1	1	0	1   98
0	2	2	1	1	1	0	0	3   95 	
0	2	2	2	1	1 	0	0	3   95
0	2	2	3	1	1	0	0	3   96
56	58	3	1	0	0	0	1	3   99
56	58	3	2	0	0	0	1	3   00 
56	58	3	3	0	0	0	1	3   00

But the spells are often longer than than the periods.
Has somebody a idea how to do this?

regards,
andrea
*
*   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