Hi, I have county-level data (variable "id2") of median age (variable "medage") for three years (variable "y," written as "1" for 2000, "3" for 2008, and "4" for 2012 ). I am trying to extrapolate this data to 2016 ("y" 5) individually by county.
I have my data so that it can be reshaped into wide or long form
I've tried to use this (long form data):
sort id2 y
tsset id2 y
tsappend, add(1)
xi: reg medage i.id2*y
predict medage2016
and this (short form) from which I could find out how to :
by id2: regress medage2012 medage2000 medage2008
In the second example, stata says that there are not enough observations to complete the regression. In the first example, I still can't quite figure out what is happening, but it involves creating several variables and interpolating the results.
I also tried using the ipolate function by creating a missing variable for all values in 2016 and using "by id2:" In this case, stata said there were too many variables...I guess the ipolate function is only for two points of observations?
Any suggestions, or is something written wrong?
Thanks!
I have my data so that it can be reshaped into wide or long form
I've tried to use this (long form data):
sort id2 y
tsset id2 y
tsappend, add(1)
xi: reg medage i.id2*y
predict medage2016
and this (short form) from which I could find out how to :
by id2: regress medage2012 medage2000 medage2008
In the second example, stata says that there are not enough observations to complete the regression. In the first example, I still can't quite figure out what is happening, but it involves creating several variables and interpolating the results.
I also tried using the ipolate function by creating a missing variable for all values in 2016 and using "by id2:" In this case, stata said there were too many variables...I guess the ipolate function is only for two points of observations?
Any suggestions, or is something written wrong?
Thanks!
Comment