Below is a copy the original data on the left side of the image, and my desired shape on the right.
Array
Here is an extract of the data in STATA format:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(id sex marital_Status sex_orient religion) 1 1 1 3 3 2 2 3 1 2 3 2 1 1 4 4 2 4 1 4 6 2 1 1 4 7 2 1 1 3 8 2 1 1 4 9 2 1 1 3 10 2 3 1 3 end label values sex sex label def sex 1 "Male", modify label def sex 2 "Female", modify label values marital_Status marital_Status label def marital_Status 1 "Married / Domestic Partnership", modify label def marital_Status 3 "Divorced", modify label def marital_Status 4 "Separated", modify label values sex_orient sex_orient label def sex_orient 1 "Heterosexual (straight)", modify label def sex_orient 3 "Bisexual", modify label values religion religion label def religion 2 "Catholic", modify label def religion 3 "Protestestant", modify label def religion 4 "Muslim", modify
Thanks again, cY
0 Response to Transpose Data from Wide to Long
Post a Comment