Built using Zelig version r packageVersion("Zelig")

knitr::opts_knit$set(
    stop_on_error = 2L
)
knitr::opts_chunk$set(
    fig.height = 11,
    fig.width = 7
)

options(cite = FALSE)

Time-Series Model with Autoregressive Disturbance with ar.

Warning: Simulation is not currently implemented for ar models.

Syntax

Currently, only the Zelig 5 reference class syntax is available for ar models:

z.out <- zelig(Y ~ X1 + X2, model = "ar", data = mydata)
setx(z.out)
# sim(z.out) # Not yet implemented

Additional Inputs

Zelig accepts the following additional inputs for ar to specify variables that provide the time index and any cross-sectional element if there are multiple time-series in the same dataset:

Examples

Single Series

rm(list=ls(pattern="\\.out"))
suppressWarnings(suppressMessages(library(Zelig)))
set.seed(1234)

Attach sample data, which has left party seat share and unemployment across time in several countries. We will subset to just those observations from the United Kingdom:

data(seatshare)
subset <- seatshare[seatshare$country == "UNITED KINGDOM",]

Estimate model:

ts.out <- zelig(unemp ~ leftseat, model = "ar", data = subset)

Summarize estimated model parameters:

summary(ts.out)

See Also

The estimator used for AR models is part of the stats package by William N. Venables and Brian D. Ripley .In addition, advanced users may wish to refer to help(ar).

z5 <- zar$new()
z5$references()


IQSS/Zelig documentation built on Dec. 11, 2023, 1:51 a.m.