Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: how to make the labels in the localname to be independent of each other?


From   gjhxmu@sina.com
To   statalist<statalist@hsphsun2.harvard.edu>
Subject   st: how to make the labels in the localname to be independent of each other?
Date   Mon, 17 Aug 2009 23:16:27 +0800

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index