Hello there,
I have a data set like this-
uid question c1 c2 c3
1 q1 2 3 6
1 q2 3 5 2
1 q3 4 5 3
2 q1 5 2 6
2 q2 3 6 2
3 q1 3 4 5
3 q2 3 5 2
3 q3 3 3 6
3 q4 4 5 2
But, I need it like this-
uid class q1 q2 q3 q4
1 c1 2 3 4 .
1 c2 3 5 5 .
1 c3 6 2 3 .
2 c1 5 3 . .
2 c2 2 6 . .
2 c3 2 3 4 .
3 c1 3 3 3 4
3 c2 4 5 3 5
3 c3 5 2 6 2
I have tried xpose, sxpose, reshape and stack.
How can I do it? Thanks in advance.
Related Posts with Partially transpose/ reshape variable in dataset
How to generate group mean variables for each time?My data is as now code pool time price a1 j1 20190101 1 a1 j1 20190102 2 a1 j2 20180101 …
Graphs Unconditional quantile regressionHello, I would like to know if you could help me with the following: I´m running the following unco…
Generating new variable for several observationsHi Everyone, I have this example below, where I have used "exapnd 12" to have each city 12 times. T…
How to compute std error for eyex marginReally, really appreciate the article "When I use the eyex option of margins, what is it actually co…
consecutive observationHi, I have read this https://www.stata.com/support/faqs/d...-observations/, and understand how to k…
Subscribe to:
Post Comments (Atom)
0 Response to Partially transpose/ reshape variable in dataset
Post a Comment