Hi Stata Forum,
I'm trying to recode a list of variables using foreach. The variables have some categories i want to code as missing, some of them, however, have a category the others don't have. What I tried to do was the following:
foreach X of var_* {
recode X 98 99 -1 =.
}
I'm not sure if the problem is that not all of var_* have the -1 category, or if I'm using foreach wrong.
Thank you in advance
Kasper Loven
Related Posts with Recoding variables using commando loops
Summarize for second level onlyDear all, I would like to ask you wheter it is possible to get information (mainly about number of …
failure to run programDear Stata Forum members, I made a program like this: cap program drop sampletps program define sa…
Generate vars with conditions inside a loopHi, I have a question, why the next sintaxis(with conditions) is not possible? foreach i of numlis…
Panel count data with repeated measurements per day, per groupHi I have a data set I could use some input on how best to analyze. Its a hierarchical data with an…
CTRL+F in browse mode not working properlyHi all, I am using a dataset with Greek characters. I've noticed that when I do a ctrl+f in browse …
Subscribe to:
Post Comments (Atom)
0 Response to Recoding variables using commando loops
Post a Comment