Hi all,

the attached picture shows data for one individual (the personal identifier is the same for all rows). The first column denotes the survey year and the second column is a dummy which takes the value 1 if someone lost his or her job in the respective year.
I would like to create a variable which sums over the past columns for each individual. So for the individual from the picture, the new variable should be . in year 1984, 1 from 1985-88, 2 from 1989-94 and 3 from 1985 onwards.
Does anyone has an idea how to do that? ;-)
Best,
Kathrin
the attached picture shows data for one individual (the personal identifier is the same for all rows). The first column denotes the survey year and the second column is a dummy which takes the value 1 if someone lost his or her job in the respective year.
I would like to create a variable which sums over the past columns for each individual. So for the individual from the picture, the new variable should be . in year 1984, 1 from 1985-88, 2 from 1989-94 and 3 from 1985 onwards.
Does anyone has an idea how to do that? ;-)
Best,
Kathrin
Comment