Hello, I have some data:
I am trying to reshape the data to wide. I do:
This works fine, but I lose the value and variable labels. I've tried following http://www.stata.com/support/faqs/da...after-reshape/, but it doesn't seem to work even with their example data. The variable labels end up as " : 80" instead of "year: 80"
Ultimately, I would like to take the variable labels such as "Gender: Number *" where * is the corresponding number from the number variable I generated. This seems to be exactly what the above link is doing, but is not working. Thanks for any help.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(hhid mem dc01) long(dc02 dc03) 2 51 2001 2 9 3 5 1990 2 7 3 12 1997 2 9 4 9 2001 3 9 4 10 2000 3 9 end label values dc02 dc02 label def dc02 2 "male", modify label def dc02 3 "female", modify label values dc03 dc03 label def dc03 7 "nephew/niece", modify label def dc03 9 "grandchild", modify
I am trying to reshape the data to wide. I do:
Code:
by hhid, sort: gen number= _n reshape wide dc*, i(hhid) j(number)
Ultimately, I would like to take the variable labels such as "Gender: Number *" where * is the corresponding number from the number variable I generated. This seems to be exactly what the above link is doing, but is not working. Thanks for any help.

Comment