Hi all,
I am trying to label variables from a local list of names. Lamentably to me, I only could label all the variables with the last name of the list, example:
Thanks in advance
Rodrigo
I am trying to label variables from a local list of names. Lamentably to me, I only could label all the variables with the last name of the list, example:
Code:
clear all set more off sysuse auto foreach v of varlist * { label var `v' "" } local names uno dos tres cuatro cinco seis siete ocho nueve diez once doce forvalues i=1(1)12 { foreach var of varlist * { local name : word `i' of `names' label variable `var' "`name'" } } describe Contains data from C:\Program Files (x86)\Stata13\ado\base/a/auto.dta obs: 74 1978 Automobile Data vars: 12 13 Apr 2013 17:45 size: 3,182 (_dta has notes) ---------------------------------------------------------------------------------------------------------------- storage display value variable name type format label variable label ---------------------------------------------------------------------------------------------------------------- make str18 %-18s doce price int %8.0gc doce mpg int %8.0g doce rep78 int %8.0g doce headroom float %6.1f doce trunk int %8.0g doce weight int %8.0gc doce length int %8.0g doce turn int %8.0g doce displacement int %8.0g doce gear_ratio float %6.2f doce foreign byte %8.0g origin doce ---------------------------------------------------------------------------------------------------------------- Sorted by: foreign
Rodrigo
Comment