Buddy wrote:
I'm crossing over from SAS, so am having problems with
some elementary procedures, so appreciate your
patience.
I'm using STATA 8.
I understand how to assign one variable to one value label
(i.e. label values variablename labelname)
I'm wondering how to assign several variables to the
same label name?
I.e. label values variable1 variable 2 labelname?
--------------------------------------------------------------------------------
Stata's help files and user's manuals will indicate that the command can
take a list of variables by displaying the command's argument as *varlist*
in the syntax diagram. If the command can take on only a single variable,
it will say *variable*. The help file indicates that -label values- takes
on only a single variable.
You can, nevertheless, easily label values of a list of variables by using
a -foreach- loop; it's three lines of code, including braces.
Joseph Coveney
foreach var of varlist variable1 variable 2 {
label values `var' labelname
}
*
* 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/