Dear Statalists,
I have a dataset in the following shape for several counties and years:
County Year Variable
1 1977 .
1 1978 .
1 1979 .
1 1980 3000
1 1981 3000
...
3 1977 .
3 1978 .
3 1979 .
3 1980 4000
3 1981 4000
...
For all counties, the values for the years 1977 to 1979 are missing for "variable" and I want to replace those missings with the value from the year 1980 of the respective county. I could find comments on how to fill in values from the top to the bottom but not vice versa. Does anyone have a suggestion for me? I suppose I will need a loop as I want to replace the values for several counties.
Thank you in advance!
Related Posts with Replace values from bottom to top
How to convert the unprojected point data in lat/lon format into projected point dat, usable in spmapHi everyone, I have a list of selected airports in lat/lon format and want to scatter these points …
What is the best test to compare regression coefficients when we use a probit model?Hello, I run two regressions for the same sample when the only difference is that there I include o…
fixed effects relative to the mean, help needed with felsdvregdmHello everyone, I've been working on this for two days and am failed to produce the results. I reall…
How to generate monthly time series data based on yearly time series data?Hello, I am wondering how to generate monthly time series data. For example, my current data set is…
"Missing Imputed Values Produced" Error MessageI am trying to run the following mi impute command to impute infractions (INF_M6a), psychological sy…
Subscribe to:
Post Comments (Atom)
0 Response to Replace values from bottom to top
Post a Comment