[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: once again -reshape- and labels

From   Andrea Bennett <>
Subject   st: once again -reshape- and labels
Date   Mon, 16 Jun 2008 18:20:08 +0200

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 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,


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:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index