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
Second stage moderated mediation in STATA using SEMHi all, I am trying to run Hayes' PROCESS Model 14 in STATA using SEM and I am getting stuck on how…
Missing Data - Replace Variable Command Issue - Using ds and foreach commandsI am using Stata version 15.1 and I have 47 variables and 1,010 observations in my dataset. I am doi…
varnorm: rejection of the null hypothesis I performed the varnorm test and results rejects the null in all the three cases (Jarque-Bera, Skew…
STATA not recognizing commandsHi, I've been running into the issue below where stata stops recognizing my commands and instead lis…
License core limitations and the future of StataThis is not quite a 'feature request' so I figured I'd post it here. Stata-MP comes in a wide varie…
Subscribe to:
Post Comments (Atom)
0 Response to Creating start and end variables
Post a Comment