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
overlapping graph lines are obscuredHi there I would like to plot multiple lines on a graph, but often these lines overlap, in which ca…
Nominal Dependent Variable and Nominal Independent Variable - Multiple Reader StudyHi Everyone, I am analyzing a study that asks participants to use a COVID diagnosis rating scale on…
collinearity diagnostics for ordered logistic regressionDear researchers, I am trying to get the VIF after running the xtologit but it doesn't work with me…
pweight not allowed - helpHello, I am trying to use the pweight subcommand, but I am getting the error that it isn't allowed. …
How to make this graph with stack option?Dear all, I would like to make a graph as shown below. In my simple example, I calculated concentra…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach recode
Post a Comment