Or,
you can -merge- and loop over labels, like so:
clear
input str20 name str20 lab
"make" "New Make and Model"
"price" "New Price"
"mpg" "New Mileage"
"rep78" "New Repair Record"
"headroom" "New Headroom"
"trunk" "New Trunk space"
end
save varlabs
sysuse auto
merge using varlabs
count if !mi(name)
forv i=1/`r(N)' {
la var `=name[`i']' "`=lab[`i']'"
}
drop _merge name lab
erase varlabs.dta
On Wed, Jan 6, 2010 at 1:05 PM, Nick Cox <[email protected]> wrote:
> Yes, if you do it interactively, e.g. within the Data Editor, in which
> case -lab var- is still implicit. But I don't think that's what you're
> seeking, as that would be more work, not less.
>
> Otherwise no. But you should be able to make it easier by a global edit
> of a text file containing the information in a decent text editor to
> produce a .do file.
>
> Nick
> [email protected]
>
> Dorothy Bridges
>
> I need to label dozens of variables. Is there a way to do this
> without using the "lab var" command for each one? I have the variable
> names and labels in an excel (or .dta) file.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/