Hi All,
Relatively straightforward issue that seems to be taking me a little too long to solve:
In the attached, I want the variable 'rexp' (routine experience) to show a value of +1 if the individual was in a routine occupation at the start and end of the previous period of transition. Each row represents a period of transition (there are 5 periods of transition, represented by the variable age).
Note that in the screenshot each unique individual appears for 5 periods of transition, but this isn't the case across the data; some are present for all 5 some aren't.
What I want is 'rexp' to be a variable that ranges from 0-4 based on how many previous periods the individual was in a routine occupation at the start and end of the previous period (i.e. when 'occgroup0'=4 and 'occgroup1'=4).
Any quick solutions?
See attached for screenshot (and my failed attempt at coding it)
Many thanks,
Ricky.
Relatively straightforward issue that seems to be taking me a little too long to solve:
In the attached, I want the variable 'rexp' (routine experience) to show a value of +1 if the individual was in a routine occupation at the start and end of the previous period of transition. Each row represents a period of transition (there are 5 periods of transition, represented by the variable age).
Note that in the screenshot each unique individual appears for 5 periods of transition, but this isn't the case across the data; some are present for all 5 some aren't.
What I want is 'rexp' to be a variable that ranges from 0-4 based on how many previous periods the individual was in a routine occupation at the start and end of the previous period (i.e. when 'occgroup0'=4 and 'occgroup1'=4).
Any quick solutions?
See attached for screenshot (and my failed attempt at coding it)
Many thanks,
Ricky.
Comment