Hello,
I would like to create start and end variables according to the data collection wave in which each participant's marital status changed.
I currently have ID, wave (1 to 5) and marstat (single, married, divorced) and I would like the data to look as follows:
ID Marstat Start End
1 Single 1 2
1 Married 2 4
1 Divorced 4 5
2 Married 1 5
3 Single 1 3
3 Married 3 5
I can't work out how to do this even though I am sure it is quite simple! Any advice would be most appreciated.
Many thanks,
Philippa
Related Posts with Creating start and end variables
How to compute p-value when the chi-square value and degree of freedom are known in Stata?I know how to compute p-value when the chi-square value and the degree of freedom are known in R, (e…
Extracting multiple dates from a stringHello, I have been provided with a dataset that contains a string variable 'term' which details the…
Confidence intervals for ICC in variance components modelsI am estimating the ICC for an outcome with data on several 10,000s nested within ~50 groups. The ou…
stata workflow book by Scott long data packages outdatedhi guys I tried to download data packages using 'findti workflow' but they are outdated and I'm usi…
How record variables to apply circsummarize: degrees or radians?I am using circsummarize to describe time of the day data (24 h clock) with the statistics mean dire…
Subscribe to:
Post Comments (Atom)
0 Response to Creating start and end variables
Post a Comment