BGtest: BGtest

Description Usage Arguments Details Value Author(s) Examples

Description

Tests autocorrelation between the current and lagged residuals. The test is a joint test of the first P autocorrelations

Usage

1
BGtest(residuals, explvariab, acor.ord)

Arguments

residuals

residuals for group i

explvariab

explanatory variables (regressors) for group i

acor.ord

order of tested autocorrelations

Details

Calculates statistics and probs of the Breusch-Godfrey autocorrelation test (with two variants: chi-squared and F

Value

Chi-squared and F statistics with probs

Author(s)

Lech Kujawski, Piotr Zientara

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# creating artificial variables
x1=rnorm(30,0,1)
x2=rnorm(30,0,1)
e=rnorm(30,0,0.2)
y=1+2*x1+3*x2+e
# any model
model=lm(y~x1+x2)
# BGtest
ExpBGtest=BGtest(residuals=resid(model), explvariab=cbind(x1,x2), acor.ord=4)
ExpBGtest

PooledMeanGroup documentation built on May 2, 2019, 12:40 p.m.