Please help identify why this loop wont work on "`x'=="Z591". I get the message "type mismatch" before the command is fully executed.
generate vaed_homeless=0
foreach x of varlist TDIAG1-TDIAG40 {
recode vaed_homeless (0=1) if (`x'=="Z590"|`x'=="Z591")
}
Related Posts with foreach
grouping dimensions with bordersI want horizontal lines separating my the levels of my first dimension. I can almost obtain this usi…
Tabulation based on multiple categorical variablesI am using Stata 17 and I’d like to produce a frequency table (tabulate one way) based on multiple v…
Quarter Averages to Yearly AveragesHello, Code: * Example generated by -dataex-. For more info, type help dataex clear input float(fu…
Logit odds ratioI am using xtlogit and have a simple model that performs as we might wish. But the odds ratio for on…
Parameter estimates scaled by SDHello Forum, Does anybody has an idea how to approach to get parameter estimates scaled by the stan…
Subscribe to:
Post Comments (Atom)
0 Response to foreach
Post a Comment