Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

# Re: st: out-of-sample prediction does not work after -regress- with lags

 From Mirko To statalist@hsphsun2.harvard.edu Subject Re: st: out-of-sample prediction does not work after -regress- with lags Date Wed, 4 May 2011 15:50:29 +0100

```Thank you Maarten for your reply.

I am not interested in the missing values at the beginng of the
sample, clearly they are missing because there is not enough
information. Instead, I would like to undestand why -predict- perfoms
the out-of-sample forecast for one data point at the end of the series
(the observations created with -tsappend-) only and not for the whole
sample when lags are presents. The problem does not occure, for
instance, when the regressor is a time trend. What am I missing here?
Thanks

Mirko

On 4 May 2011 12:41, maarten buis <maartenlbuis@googlemail.com> wrote:
> On Wed, May 4, 2011 at 1:24 PM, Mirko wrote:
>> I cannot get out-of-sample forecasting after a regression with lags:
>>
>> According to the manual, "-predict- can be used to make in-sample or
>> out-of-sample predictions:
>> 6. predict calculates the requested statistic for all possible
>> observations, whether they were used in fitting the model or not."
>>
>> However from the example above only one out of sample data is predicted.
>
> To do out of sample predictions Stata must know the values of all
> explanatory variables. So, in order to predict the outcome Stata needs
> to know all the lagged values. If these are missing than what should it
> predict? Prediction is just filling in an equation, if one of the elements
> is missing than the result will be missing.
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
>
> http://www.maartenbuis.nl
> --------------------------
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index