Hi all,
I am trying to label multiple variables at once using loop.
For instance, variables q2_4_1_1,...,q2_4_1_6 should all be labelled as "Cows"
On the other hand, variables q2_4_2_1,...,q2_4_2_6 should all be labelled as "Chicken"
I have tried the following:
[CODE][local x=1/6
local y=1/3
local localvarlabels "Cows" "Chicken" "Goats" "Others"
foreach v of varlist q2_4_`x"_`y" q2_4_`x"_99 {
label var `v' "`localvarlabels`"
}
/CODE]
Can someone please tell me what am I doing wrong here?
Thanks in advance.
Related Posts with Trying to label multiple variables using loop
How to calculate distance in this case?Dear all, I would like to calculate a distance as follows: distance is defined as the straight-line…
about mixed command and the random effectsDear professors When I type the command "mixed education culture ses100 $var || schids: culture, …
How to correctly interrupt the moderating effect in a modelDear all I have three variables: New.gw is my x and log_spread is my Y and the moderator is a legal …
Problems with the ARIMA model for white noise testingThe variable is log return, which has been confirmed as a stationary series by the DF test, I choose…
set string case to missing if a phrase is foundHello, I have a series of string variables (drug1 - drug25) that contain information on types of dr…
Subscribe to:
Post Comments (Atom)
0 Response to Trying to label multiple variables using loop
Post a Comment