I have a set of variables with names such as "tibia_epiCSA1" where the last character is sometimes a "2" rather than a "1"; I want to change the current variable labels (which come from a -reshape- command) to have "start" as the first word if the last character in the varname is "1" (or to have "end" as the first word of the variable label if the last character in the varname is "2") and then to copy the variable name except that I want to exclude the last character (the "1" or the "2"); I get part way via
but this still leaves me the ending digit
open to a different strategy or to a follow-up command that will get rid of the digit
I note that I have several dozen such variables so want a general way to do this
Code:
local mac1 tibia_epiCSA1 la var tibia_epiCSA1 "start `mac1'"
open to a different strategy or to a follow-up command that will get rid of the digit
I note that I have several dozen such variables so want a general way to do this
Comment