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
Question about the effect of adding control variables on estimateDear all, I do a research using instrumental variables, the main problem is that we are not sure wh…
How do I perform VIF test after xtregDear Experts, I have run the following xtreg xtreg x fdi l k m lc, fe vce(robust) Is there need to p…
Issues with attempts to drop observations (r109 type mismatch error)Hi there, I'm new to Stata and attempting to drop some observations from my sample, however I keep …
Drop variables with common suffix under certain conditionsDear all, I am facing difficulties in dropping some variables conditional on the missing observatio…
Oaxaca help - mean wage generated does not match the one given by sum commandGood afternoon, I am using the oaxaca command to decompose the ethnic pay gap, in the example here …
Subscribe to:
Post Comments (Atom)
0 Response to Foreach recode
Post a Comment