lbtest: Ljung-Box for residual test.

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/lbtest.R

Description

Compute the Box<c2><a8>CPierce or Ljung<c2><a8>CBox test statistic for examining the null hypothesis of independence in a given time series.

Usage

1
lbtest(x, type = "Ljung-Box", lag = c(6, 12))

Arguments

x

a numeric vector or univariate time series.

type

one of the Box<c2><a8>CPierce or Ljung<c2><a8>CBox,Default is Ljung<c2><a8>CBox test.

lag

the statistic will be based on lag autocorrelation coefficients.Lag can be set at any time ,default is 6 and 12.

Value

lag

the lag.

LB.values

the value of the LB test statistic.

chisq.values

the value of chisq-values.

p.values

the p-value of the test.

Note

Missing values are not handled.

Author(s)

Jinquan Lin

See Also

Box.test

Examples

1
2
3
4
5
6
7
8
##----

data(tableA17)
x=tableA17[2]
lbtest(x)
lbtest(x,lag=1:12)
lbtest(x,lag=c(6,12,18))
lbtest(x,type="Box-Pierce",lag=c(6,12))

jinimp/zhbit7 documentation built on May 19, 2019, 10:36 a.m.