Dear statalists,
I generate a localname to stand for the var labels of certain variables.
However, there are spaces in the labels of certain variables.
How to let stata treat each label as a complete unit?
For example,
clear
input x y
1 2
3 9
end
l
la var x "the first"
la var y "the second"
foreach i of varlist _all {
loc labels "`labels' `: var l `i''"
}
di "`labels'"
the first the second
di "`: word count `labels''"
4
In fact my purpose is to generate a localname including two labels, and the word count
of it is 2.
Could anyone help me ? Thank you.
Best regards,
Rose.
*
* 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/