|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: once again -reshape- and labels
Dear Statalisters,
I thought I should be able to succeed myself in doing a -reshape long-
and preserve the variable's label, e.g. I have Ax1 Ax2 Ax3 with every
Ax1-Ax3 having the very same label, but even though having a look at http://www.stata.com/support/faqs/data/variables.html
and trying to borrow from there, I couldn't get it to work. I now
have stored the first variable's label of each variable I need to
reshape (e.g. the label for Ax1 Bx1 Cx1) but cannot get it applied to
the new variables (after reshape) which are called Ax, Bx and Cx.
My code so far:
local lrshp "Ax1 Bx1 Cx1"
foreach v of var `lrshp' {
local l`v' : variable label `v'
if `"`l`v''"' == "" {
local l`v' "`v'"
}
}
Does any of you macro masters have a good line of help?
Many thanks for your consideration,
Andrea
P.S. If someone got an idea for automatically renaming Ax, Bx and Cx
to A, B, and C, that would be great, too.
*
* 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/