Statalist The Stata Listserver

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

st: Is it safe?

From   Clive Nicholas <>
Subject   st: Is it safe?
Date   Mon, 26 Feb 2007 00:41:51 +0000 (GMT)

Divya asked:

I'm trying to fit some ARMA models to some time-series data I have
and trying to make one-step-ahead forecasts with the following

arima x, arima(1,0,0) //a simple AR(1) model
predict xhat, xb


Sticking to your set commands and skipping over the autoregressive parameter = .25, this will work:

. webuse sp500, clear

. tsset date

. arima volume, arima(1,0,0)

. predict static if tin(02jan2001,31dec2001), y

A nice touch is to graph your one-step-ahead forecasts against the observed trend, thus:

. tsline volume static if tin(02jan2001,31dec2001), scheme(economist) legend(cols(1) stack)

Hope that helps,
Clive Nicholas

The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider.

*   For searches and help try:

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