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
Generating missing dataHi! i have a panel of data with a single misuration for every months over 8 years. For some months …
destring when numerical values with < or > signsHello, I am working on epidemiological data and I have a couple of variable from biomarkers for whi…
How to delete the first two letters from a string variable?Hello Mr Mrs Help I have a variable called bvid. It is in a form of either abxxxxxxxx or xxxxxxxxxx…
The Deflator index, again.Hello all, I did two posts about this, but I am having trouble swimming through the data. The value…
Different way of clustering with reghdfeHello everyone! I'm currently running a multi-way fixed effect regression using the command reghdfe…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding variables using commando loops
Post a Comment