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 I simulate a random intercept and slope mixed poisson modelHi, Please could you tell me how do I simulate a random coefficient mixed poisson model? How do I …
How to implement the herding measure proposed by Lakonishok et. al (1992) in stataHi all I am currently calculating herd behavior on the trading platform "Robinhood" and I am using …
Include slope on binscatter plotHello, I am new to Stata - I was wondering if there is a way to add the value of the slope to binsc…
How to calculate a running covarance and store the values?Hi, I have panel data, permno is my panel variable. I want to create covariance between returns and …
Program to copy packages to local folderA recent thread on this forum inspired me to ask an opposite question of sorts. In environments wher…
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