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
Urgent: How to change the relationship according to HH serial numberDear All, How can I select and create a new data set with all household heads and those household w…
create new variable with multiple conditionsHello expert stata I'm new to stata. I had an exercise from the class for analysing the data. the fi…
How do i transform categorical variables to continuous scores?Hello Statlist, I am working on the Health Information National Trends Survey (HINTS) which has 7 v…
weighting dataI have an unbalanced panel data, and I'm trying to weight my sample to look like the population. sup…
estout - how to keep interactions (of time series operators and indicators)Dear Statalisters, I am trying to output regression results to .tex using estout (from ssc, using S…
Subscribe to:
Post Comments (Atom)
0 Response to Partially transpose/ reshape variable in dataset
Post a Comment