Hi,
I am working on a dataset with the Gini coefficient for different country-years. Since the original dataset has some missing values, I have used ipolate to generate interpolated values with the following command:
The dataset then looks like this:
Now I would like to estimate the value for years outside of the data range, such as 1978 or 1979. The option epolate, however, extrapolates values for all the years present. I would like to restrict the extrapolation only to a three-years timeframe (three years before the first non-missing value and three years after the last non-missing value). For example, in this case, I would like to extrapolate values for 1977–1979 but not for 1976 or 1975.
Thanks a lot!
I am working on a dataset with the Gini coefficient for different country-years. Since the original dataset has some missing values, I have used ipolate to generate interpolated values with the following command:
Code:
by countryname: ipolate gini year, gen(gini_int)
Code:
countryname year gini gini_int Argentina 1975 . . . Argentina 1976 . . . Argentina 1977 . . . Argentina 1978 . . . Argentina 1979 . . . Argentina 1980 40.8 40.799999 Argentina 1981 . 41.133333 Argentina 1982 . 41.466666 Argentina 1983 . 41.799999 Argentina 1984 . 42.133333 Argentina 1985 . 42.466666 Argentina 1986 42.8 42.799999 Argentina 1987 45.3 45.299999 Argentina 1988 . 45.674999 Argentina 1989 . 46.049999 Argentina 1990 . 46.424999 Argentina 1991 46.8 46.799999
Now I would like to estimate the value for years outside of the data range, such as 1978 or 1979. The option epolate, however, extrapolates values for all the years present. I would like to restrict the extrapolation only to a three-years timeframe (three years before the first non-missing value and three years after the last non-missing value). For example, in this case, I would like to extrapolate values for 1977–1979 but not for 1976 or 1975.
Thanks a lot!
Comment