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/