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 output the results from mata to stata variable?I want to store the reuslts "1", how to do that? Code: * Example generated by -dataex-. To install:…
Collapsing data by both weighted and unweighted meansI have a dataset of ~100K, and I'd like to collapse the data for variable Alpha into its mean, and v…
Need Help Appending a Column Using AsdocDear all, I am using Stata 16, on mac and have provided a sample of my dataset using dataex at the …
Simple Binary Outcome QuestionHello, I am having a problem understanding a simple statement that I need to code in Stata. Define…
Need help with creating first difference operator for regression - econometricsHi There Everyone. I hope you're all well. I had a question, I'm really lost - i need to create a f…
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