R : Copyright 2001, The R Development Core Team Version 1.3.1 (2001-08-31) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()' for distribution details. R is a collaborative project with many contributors. Type `contributors()' for more information. Type `demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. > library(ts) > data(UKDriverDeaths) > plot(UKDriverDeaths) > diff.1 <- diff(UKDriverDeaths,12) > plot(diff.1) > par(mfrow=c(1,2)) > acf(diff.1,lag.max=40) > pacf(diff.1,lag.max=40) > seatbelt <- as.matrix(c(rep(0,169),rep(1,23))) > fit <- arima0(UKDriverDeaths,order=c(1,0,1),seasonal=list(order=c(0,1,1),period=12), xreg=seatbelt) > print(fit) Call: arima0(x = UKDriverDeaths, order = c(1, 0, 1), seasonal = list(order = c(0, 1, 1), period = 12), xreg = seatbelt) Coefficients: ar1 ma1 sma1 xreg1 0.9360 -0.6042 -0.8898 -346.9095 Approx standard errors: ar1 ma1 sma1 xreg1 0.0550 0.1328 0.0117 86.0320 sigma^2 estimated as 16767: log likelihood = -1139.96, aic = 2287.93 > fcast <- predict(fit,n.ahead=12,newxreg=as.matrix(rep(1,12))) > plot(UKDriverDeaths,xlim=c(1969,1986),ylim=c(900,2600)) > lines(fcast$pred,col=2) > lines(fcast$pred + 2*fcast$se,col=3) > lines(fcast$pred - 2*fcast$se,col=3) >