[email protected]
>
> Dear Stata Users,
>
> How to teel Stata to conserve the labels of variables while
> reshaping a dataset?
>
Does -reshape- ever zap variable labels? Evidently.
Please see
How can I collapse my dataset and keep the same variable labels?
http://www.stata.com/support/faqs/data/variables.html
I would copy them all before the -reshape-
foreach v of var * {
local l`v' : variable label `v'
}
Then after -reshape- check all
variable labels and replace blanks by
any saved labels:
foreach v of var * {
local L`v' : variable label `v'
if `"`L`v''"' == "" & `"`l`v''"' != "" {
label var `v' `"`l`v''"'
}
}
Nick
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/