I have a question using the code -reshape-.
For each year denoted by alphabet 'a' to 'd'. Ex) 2000 stands for year 'a' and 2004 stands for year 'd', I have two variables *sts and *strc.
I would like to convert the wide data into long version.
I tried
Code:
reshape *sts *strc, i(id) j(year)
Do I need to convert the variable names first? Is there a restriction in using -reshape-?
Thank you so much!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3 id byte(asts astrc bsts bstrc csts cstrc dsts dstrc) "003" 14 1 14 1 12 1 -8 -8 "005" 12 1 -8 -8 -8 -8 -8 -8 "006" . . 37 4 -8 -8 26 3 "007" . . -8 -8 -8 -8 . . "008" 13 1 . . . . . . "009" 24 3 . . . . . . "010" 14 1 17 2 15 1 15 1 "011" -8 -8 -8 -8 . . . . "012" -10 -10 -10 -10 . . . . "013" -10 -10 -10 -10 . . . . "014" 17 2 14 1 18 2 15 1 "015" 15 1 13 1 25 3 28 3 "016" 12 1 14 1 13 1 15 1 "018" 21 2 16 2 25 3 26 3 "019" 14 1 13 1 15 1 12 1 end
0 Response to Reshape wide to long
Post a Comment