Dear All, I have this data set,
Code:
clear
input int year double(inf gdp) float(inf1 gdp1)
1990  5.72458974   3.9071139          .         0
1991  6.68398563  9.29407591    5.72459  3.907114
1992  8.19824765 14.21616358   6.683986  9.294076
1993 15.20220481 13.86757602   8.198248 14.216164
1994 20.60060944 13.05215872  15.202205 13.867576
1995  13.6705391 10.94922737   20.60061 13.052158
1996  6.50109595  9.92837246   13.67054 10.949227
1997  1.62216042  9.23076923   6.501096  9.928372
1998  -.89258936  7.83761392  1.6221604  9.230769
1999 -1.26840965  7.66748617  -.8925893  7.837614
2000  2.06146138  8.49150849 -1.2684096  7.667486
2001  2.04311501  8.33991055  2.0614614 8.4915085
2002   .60485066  9.13064594   2.043115 8.3399105
2003  2.60544121 10.03560303   .6048506  9.130646
2004   6.9543218 10.11122346   2.605441 10.035603
2005  3.90263978 11.39577594   6.954322 10.111223
2006  3.92791085 12.71947902    3.90264 11.395776
2007  7.74917984 14.23138804   3.927911  12.71948
2008  7.79180194  9.65428937    7.74918 14.231388
2009   -.2105339  9.39981317   7.791802  9.654289
2010  6.88114487 10.63614046  -.2105339  9.399813
2011  8.07559638  9.55091409   6.881145  10.63614
2012  2.33512068  7.85962749   8.075597  9.550914
2013  2.16101914  7.76861528  2.3351207  7.859628
2014     .791193  7.29951892   2.161019  7.768615
2015   .06269939  6.90531667    .791193  7.299519
2016  1.07275629  6.73667525  .06269939  6.905317
2017  3.88416989  6.75700761  1.0727563  6.736675
2018  2.93333231  6.56697386    3.88417  6.757008
end
I'd like to regress current `inflation' on the `lagged inflation' and `lagged gdp' (along with a constant), and obtain the predicted inflation and residual for each year. The regressions are performed on a recursive window where the first period is fixed. I know that, in the usual cases, this can be done by (please ssc install rangestat)
Code:
rangestat (reg) inf inf1 gdp1, interval(year . 0)
However, how can I use the estimated coefficients to obtain the predcited values of inflation for each year? Thanks.