Dear Stata experts,
Here's the sample data
ID Clinical_1 Clinical_2 Clinical_3 Visit_4 Visit_5
1 0 0 1 4 5
2 0 1 1 4 5
reshape long Clinical Visit, i(ID) j(timepoint visit) but this code is not resulting the long format like below
Is there a way to reshape in a long format like the below. Please advise. Thank you so much
ID timepoint Clinical Visit
1 1 0 .
1 2 0 .
1 3 1 .
1 4 . 4
1 5 . 5
2 1 0 .
2 2 1 .
2 3 1 .
2 4 . 4
2 5 . 5
Related Posts with Wide to long reshape-- Is it possible to include two variables in code for "j"
How to split numeric variables based on ruleHi Stata folks, I am working on a dataset where each ID is associated with a numeric value comprised…
How to fix "repeated time values within panel"Now I have data like: hhid geo 1 1 1 1 2 2 2 2 3 3 3 3 And I use command "xtset hhid geo", there is…
Download (install) all packages in SSC?Dear All, Is it possible to install all the packages in SSC using one simple command (whatever that …
subtracting datesPlease help. In my data set the dates are in the format: 17dec2016 00:00:00. I am trying to subtract…
Combining two variables into one decimalHi all, I'm sure this is a relatively easy thing to do once you know the syntax, but essentially I h…
Subscribe to:
Post Comments (Atom)
0 Response to Wide to long reshape-- Is it possible to include two variables in code for "j"
Post a Comment