Hello. Sorry, if my question seems stupid to you, im fairly new to stata and cant seem to figure out the problem on my own.
I want to recode a list of variables at the same time by using the loop foreach. My problem is that the following syntax seems to be wrong:
foreach var of varlist v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 {
recode `var' (4=2)
}
I would appreciate it if someone would tell me what i'm doing wrong or what i'm missing in the syntax.
Thanks in advance
Related Posts with Foreach recode
Changing the contents in a variableI wanted to change the contents in a variable. The variable, termed "outcome" contains integer numbe…
different results with rhausman codeDear All, I get different results each time when I run the code "rhausman FE RE, cluster " for the …
ppml: e(converged) equals neither 0 nor 1When I run the following command Code: ppml value ExporterFE* ImporterFE* ${bilaterals} and then ty…
logistic regression with multigroup nominal and ordinal independent variablesHi Stata experts I am doing multiple regression i Stata followed by logistic regression. My dep.var…
Positive and significant conventional CI but negative significant robust CI in RDDDear all statlists, I have a problem when I try to interpret my results from a regression discontin…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach recode
Post a Comment