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
Principal Component Analysis (Creating an Index using Multiple Scores)Hello, everyone. I am computing an index using Principal Component Analysis. After running the PCA c…
Decomposing regression into within and between effectsConsider the following baseline model: yijk = beta * xijk + errorijk where i indicates a child, j i…
Flexible parametric modelling, models do not convergeHi, I’m using the -stpm2- command to generate a flexible parametric model (relative survival, >1…
f test following reghdfe for joint significance of individual fixed effectsHi all, I'd like to run a f-test to test joint significance of each fixed effects. For example, I'd…
Panel Data : Insufficient Observations (Singletons or separated by a fixed effect)Good day, I am using Stata 16 to run a fixed effect on effect Non Tariff Measures ( ADP QR SG SPS T…
Subscribe to:
Post Comments (Atom)
0 Response to Trying to label multiple variables using loop
Post a Comment