Hello all,
I am working with a very large (~65,000 observations) repeated measures data set. Currently, the data is setup in long format. How do I create an indicator variable based on change in variable at different timepoints?
This is what I have:
ID Count Smk_status
1 1 Never
1 2 Never
2 1 Former
2 2 Former
2 3 Former
3 1 Never
3 2 Current
3 3 Former
This is what I want:
ID Count Smk_status Smk_trajectory
1 1 Never Never
1 2 Never Never
2 1 Former Former
2 2 Former Former
2 3 Former Former
3 1 Never Inconsistent
3 2 Current Inconsistent
3 3 Former Inconsistent
I can do this in wide format of data but I am just wondering if anyone has any suggestions to do this in long format of data.
Thanks in advance!