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
Multiple linear regression with specific to general approachHello everyone, I want to regress a multiple linear regression with specific-to-general approach. D…
Non-Inferiority between two groups with no differenceThe statistical analysis I am wanting to run is for a non-inferiority study design, where treatment …
stacked bar graph for different years showing shares of countriesDear all, I want to produce a graph from a dataset containing the production of aluminum in differe…
Calculation of the "T" statistic for High minus (-) Low double sort portfolioI have a double sort portfolio results based on two variables (X and Y). I would like to calculate t…
Reshape Long HelpI'm normally pretty competent when it comes to reshaping data. However, I am running into trouble he…
Subscribe to:
Post Comments (Atom)
0 Response to Replace values from bottom to top
Post a Comment