Hi everyone. I am trying to fill in missing values in one variable by completing it with values from another one. I am working with observations with often lack the end date, in which case I want to make the end date be the same as the start date. I use this code:
foreach x of end_year {
replace end_year = start_year `x' if missing(end_year`x')
}
and I am getting an error message saying "invalid 'end_year'). Nevertheless, I have triple checked for extra spaces, but this does not seem to be the issue. What could it be? Thank you.
Related Posts with Loop foreach help
Reshape errorHi all, I need help in reshaping long (year2007-year2012). The desired outcome would be something l…
Converting ISCO1988 4 digit codes to ISCO2008Hi, I am lost in using iscogen. I need to convert an old dataset isco88 4 digits occupation classifi…
est tab marginsDear all, I cannot have the results I want in the est tab output using : Code: quietly probit Y i.…
Twoway scatter plotHello, I hope it's a relatively simple question, but I don't know how to do it. I want to make fou…
Help with ICC's of vertical jump measuresI am trying to run a simple reliability analysis on a dataset. There is one rater (a vertical jump m…
Subscribe to:
Post Comments (Atom)
0 Response to Loop foreach help
Post a Comment