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"
counting 1s in each groupHi STATALIST, I have variables group and order. I want a new variable which is counting 1s in the v…
combining three twoway kdensity grapghs togetherUsing the below codes, I could create three nice kdensity plots. I was wondering if there is any way…
Adding F-Stat of first stage regression using ivreghdfe and estoutMy code is the following Code: eststo: ivreghdfe y (x=z), a(Year) first savefirst savefprefix(st1)…
Panel VECM post estimation or two-step replication with -pvar-Hi Statalists, I am fitting a panel VECM model with -xtpmg-. I am looking for the methods to conduc…
how to solve for a nonlinear equationHello, I'm looking for a way to solve this equation in Stata: 0.1(w+2000000)^(1-r) + 0.9(w-z)^(1-r…
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