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
Problem regarding imputation of missing valueHii I am working on self reported cross section data set. Most of the variable are ordinal in nature…
Diagnostic tests for correlated random effects modelHi, What diagnostic tests can be done on a correlated random effects model? And if so how do I code…
Fractional polynomials and nonlinear least-squares estimationIs there a fundamental reason why fractional polynomials (either -fp- or -mfp-) are not allowed when…
Fixed effect xtreg - Panel data - P-valueHey everyone, I'm trying to find the regression of my panel dataset. I'm trying to calculate the re…
non parametric regression discontinuity with interaction termi am writing to ask if is it possible to do a non parametric regression discontinuity with an intera…
Subscribe to:
Post Comments (Atom)
0 Response to Loop foreach help
Post a Comment