Hi,
I wish to assign labels to multiple variables. I am aware of the elabel command in SSC, however I wanted to see how I could do it using loop. This is the code I used:
However, I get the error 'invalid syntax r(198)' when I run this code. Could someone explain to me why I am getting an error?
Thank you!
I wish to assign labels to multiple variables. I am aware of the elabel command in SSC, however I wanted to see how I could do it using loop. This is the code I used:
Code:
local varlist t_hhexp school_fees pvt_tuition t_childrensedu_exp local labels "Household expenditure" /// "School fees" /// "Private tuition fees" /// "Children's education expenditure" local i = 1 foreach var of local varlist { label variable `var' : word(`labels', `i') local ++i }
Thank you!
Comment