# st: linear interpolation

 From Scott Cunningham To statalist@hsphsun2.harvard.edu Subject st: linear interpolation Date Tue, 25 Jul 2006 16:20:11 -0400

Rafal,

I know I need to expand by 31,815 observations (1761 for every year in the 1980s and 1774 for every year in the 1990s).

. local N = `_N' + 31815

. set obs `N'
obs was 5318, now 31815

What I'm trying to figure out now is to assign values of a year for every 1761 observations through the 1980s, then 1774 for every year in the 1990s. For instance, to do this:

year
1981
1981
...
1981

(where the total is 1,761 for 1981, and the same would be for 82-89, and 1774 per year for 1991-1999). I don't think using what you wrote, ". replace year=1975 + _n if year==." will work since I do not need year increasing with every observation. Does anyone know how to fill in missing data with such precision?

sc
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/