Greetings, Stata Lovers!
label define outcome 0 "No" 1 "Yes".
I have several variables, e.g., var1 to var25.
I want to attach the same labels (outcome) to all these variables.
Right now, I have to individually label each variable using the following command:
label value var1 outcome.
label value var2 outcome.
label value var3 outcome.
label value var4 outcome.
label value var5 outcome.
and so on....
Is there an easier way of doing it? Maybe using the 'foreach' loops.
Regards
Stata Beginner.
label define outcome 0 "No" 1 "Yes".
I have several variables, e.g., var1 to var25.
I want to attach the same labels (outcome) to all these variables.
Right now, I have to individually label each variable using the following command:
label value var1 outcome.
label value var2 outcome.
label value var3 outcome.
label value var4 outcome.
label value var5 outcome.
and so on....
Is there an easier way of doing it? Maybe using the 'foreach' loops.
Regards
Stata Beginner.
Comment