rackauskas_zuokas {skedastic} | R Documentation |
Rackauskas-Zuokas Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the two methods of Rackauskas and Zuokas (2007) for testing for heteroskedasticity in a linear regression model.
Usage
rackauskas_zuokas(
mainlm,
alpha = 0,
pvalmethod = c("data", "sim"),
R = 2^14,
m = 2^17,
sqZ = FALSE,
seed = 1234,
statonly = FALSE
)
Arguments
mainlm |
Either an object of |
alpha |
A double such that |
pvalmethod |
A character, either |
R |
An integer representing the number of Monte Carlo replicates to
generate, if |
m |
An integer representing the number of standard normal variates to
use when generating the Brownian Bridge for each replicate, if
|
sqZ |
A logical. If |
seed |
An integer representing the seed to be used for pseudorandom
number generation when simulating values from the asymptotic null
distribution. This is to provide reproducibility of test results.
Ignored if |
statonly |
A logical. If |
Details
Rackauskas and Zuokas propose a class of tests that entails
determining the largest weighted difference in variance of estimated
error. The asymptotic behaviour of their test statistic
T_{n,\alpha}
is studied using the empirical polygonal process
constructed from partial sums of the squared residuals. The test is
right-tailed.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Rackauskas A, Zuokas D (2007). “New Tests of Heteroskedasticity in Linear Regression Model.” Lithuanian Mathematical Journal, 47(3), 248–265.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
rackauskas_zuokas(mtcars_lm)
rackauskas_zuokas(mtcars_lm, alpha = 7 / 16)
n <- length(mtcars_lm$residuals)
rackauskas_zuokas(mtcars_lm, pvalmethod = "sim", m = n, sqZ = TRUE)