Hello,
Can anyone suggest how to automate the saving of value label definitions and reapplication of them to variables after reshaping from wide to long (using Stata 19)?
I successfully followed instructions in this old Stata FAQ (https://www.stata.com/support/faqs/d...after-reshape/) to replace my variable labels. But I can't get the FAQ's code for saving value labels to work even when I use the FAQ's example dataset and example code, nor does the FAQ explain how to re-apply value labels if you do successfully save them before the reshape. (StataCorp has put a note at the top of this FAQ that says the solution doesn't apply versions after Stata 11, so I'm assuming this is why I can't get the example code for value labels to work.) I have found hundreds of StataList suggestions for replacing variable labels after reshaping, but I haven't been able to find posts about replacing value labels.
Many thanks in advance for your help,
Melissa
Can anyone suggest how to automate the saving of value label definitions and reapplication of them to variables after reshaping from wide to long (using Stata 19)?
I successfully followed instructions in this old Stata FAQ (https://www.stata.com/support/faqs/d...after-reshape/) to replace my variable labels. But I can't get the FAQ's code for saving value labels to work even when I use the FAQ's example dataset and example code, nor does the FAQ explain how to re-apply value labels if you do successfully save them before the reshape. (StataCorp has put a note at the top of this FAQ that says the solution doesn't apply versions after Stata 11, so I'm assuming this is why I can't get the example code for value labels to work.) I have found hundreds of StataList suggestions for replacing variable labels after reshaping, but I haven't been able to find posts about replacing value labels.
Many thanks in advance for your help,
Melissa
Comment