Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: linear interpolation


From   Scott Cunningham <[email protected]>
To   [email protected]
Subject   st: linear interpolation
Date   Wed, 19 Jul 2006 13:35:25 -0400

I have data from the 1980, 1990 and 2000 Census, and need to linearly interpolate the in-between years (1981-1989, 1991-2001, 2002-2005). For now, I am assuming a constant rate of growth each year. Let D80 equal the 1980 value, D90 equal the 1990 value and r be the rate of growth per year. Solving this means solving the following equation for r:

D1*(1+r)^10=D2

I had two questions. How do I create a panel for 1981-1989, 1991-1999, 2001-2005 to insert these missing values? Assume the data is in this format:

YEAR D STATE
1980 100 1
1980 3 2
1990 200 1
1990 4 2

I want to create YEAR values for 1981-1989, etc., and then after doing that, create corresponding estimates for each state. This means calculating two different values for r, and then using that value to estimate each of the missing years. I think I will need to use the -expand- command, but I wasn't sure if there was a simple way to do this, such as with an ado file already created for exactly this sort of thing.

thanks,


scott
*
* 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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index