Description Usage Arguments Details Value Author(s) References See Also Examples
Run the Ljung-Box test
1 | ljungbox_test(x, k = 25, ...)
|
x |
a vector, usually of residuals |
k |
an integer indicating the number of lags to compute the autocorrelation coefficients |
... |
further options for |
This function implements the the Ljung-Box test for autocorrelation coefficients. The null hypothesis of the test is H_{0}: ρ(1)=ρ(2)=\cdots=ρ(k) for k<≤ft(n-1\right). The test statistic depends on k
.
A list containing the following objects
statistic |
the test statistic |
p.value |
the p-value |
df |
the degrees of freedom of the chi-squared distribution of the test statistic |
n.used |
the number of observations used for autocorrelations computation |
data.name |
the name of the input variable |
Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br
Schwartz, J., Spix, C., Touloumi, G. et al. (1996) Methodological issues in studies of air pollution and daily counts of deaths or hospital admissions. J Epidemiol. Community Health 50 (suppl 1), S12–S18.
Spanos, A. (1999) Probability Theory and Statistical Inference. Cambridge.
1 2 3 4 5 6 | data(admrio)
setup(admrio,"date")
f <- resp5~s(time)+weekdays+s(tmpmax)
m <- fit_core(f)
r <- get_residuals(m)
ljungbox_test(r,25)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.