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

st: RE: new spell variable


From   [email protected]
To   [email protected]
Subject   st: RE: new spell variable
Date   Wed, 19 Feb 2003 13:04:43 -0500

Andrea Schaefer, [email protected]
> 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?

Looking at the values of your _fam*_ variables, it is not clear to me how
the values of _year_ ought to be determined?  Also, what is your group
identifier -- all combinations formed by _id_ and _seqvar_?  Could you
please elaborate?


Patrick Joly
[email protected]
[email protected]
*
*   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