Hi all,
Firstly, sorry if this has been asked before. But i couldn't find answers in the manual or in the forum on this.
I want to make a specific out-of-sample point forecast, but using the predict command does not seem to work. For example, I have a data set with 50 observations of GDP data over a period 1961 - 2010. I created a dummy time variable gen time = _n, and want to do a simple linear model and generate a one-period-ahead forecast at period t=51. These are my steps:
1) reg GDP time
2) set obs 60
3) predict gdphat1 if time>(50)
(option xb assumed; fitted values)
(60 missing values generated)
Example of my dataset:
Year GDP time
....
2008 166792.3 48
2009 175934.9 49
2010 213154.5 50
...
Doing the 3rd step returned all missing values. How do we specifically generate the 51st value? (of course i know how to do this manually, but i was wondering if stata can do this)
Thanks in advance.
Firstly, sorry if this has been asked before. But i couldn't find answers in the manual or in the forum on this.
I want to make a specific out-of-sample point forecast, but using the predict command does not seem to work. For example, I have a data set with 50 observations of GDP data over a period 1961 - 2010. I created a dummy time variable gen time = _n, and want to do a simple linear model and generate a one-period-ahead forecast at period t=51. These are my steps:
1) reg GDP time
2) set obs 60
3) predict gdphat1 if time>(50)
(option xb assumed; fitted values)
(60 missing values generated)
Example of my dataset:
Year GDP time
....
2008 166792.3 48
2009 175934.9 49
2010 213154.5 50
...
Doing the 3rd step returned all missing values. How do we specifically generate the 51st value? (of course i know how to do this manually, but i was wondering if stata can do this)
Thanks in advance.
Comment