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
Assigning labels as variable valuesI am using encode to convert a variable from string to numeric type so that I can use it in a regres…
Calculating birthdate from age and age at test dateHow do I calculate birthdate from the age at test date (ageIGA) and the test date (tvdIGA)? Variabl…
plotting means + cis using imputed data and coefplotHi everyone, I hope you'll be able to help me with this question. I have multiple years of cross-se…
logistic regression standard errorsHi All, When I run the logit command I get the following result outcome | Coef. Std. Err. z P>|…
Kaplan meier survival analysisplease, guys, I want to perform a Kaplan Meier survival analysis with stata, someone could help me??…
Subscribe to:
Post Comments (Atom)
0 Response to Partially transpose/ reshape variable in dataset
Post a Comment