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
Reshaping from "strange" to long formatDear StataListers, I use Stata 14.2. Here is a simplified example of my data (three cities, three y…
Blinder-Oaxaca Decomposition with group specific variablesI would like to run a Blinder-Oaxaca Decomposition on black-white differences. I have panel data whe…
Panel data with messy time, very large NDear users, My data consists of N=1033 and T=1-15, with a total number of observation of 2300. Time…
How to set width Stata MP 16.1 for UnixHello, I am using Stata 16.1 (64-bit, total usable memory 1510.3 GB), and trying to change an extre…
Regressing Firm-specific variables against Macroeconomic variablesHello, I am using panel data with the following observations: The firm-specific dependent variable…
Subscribe to:
Post Comments (Atom)
0 Response to foreach
Post a Comment