diblasi_bowman {skedastic} | R Documentation |
Diblasi and Bowman's Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the nonparametric test of Diblasi and Bowman (1997) for testing for heteroskedasticity in a linear regression model.
Usage
diblasi_bowman(
mainlm,
distmethod = c("moment.match", "bootstrap"),
H = 0.08,
ignorecov = TRUE,
B = 500L,
seed = 1234,
statonly = FALSE
)
Arguments
mainlm |
Either an object of |
distmethod |
A character specifying the method by which to estimate
the |
H |
A hyperparameter denoting the bandwidth matrix in the kernel
function used for weights in nonparametric smoothing. If a double of
length 1 (the default), |
ignorecov |
A logical. If |
B |
An integer specifying the number of nonparametric bootstrap
replications to be used, if |
seed |
An integer specifying a seed to pass to
|
statonly |
A logical. If |
Details
The test entails undertaking a transformation of the OLS residuals
s_i=\sqrt{|e_i|}-E_0(\sqrt{|e_i|})
, where E_0
denotes
expectation under the null hypothesis of homoskedasticity. The kernel
method of nonparametric regression is used to fit the relationship
between these s_i
and the explanatory variables. This leads to a
test statistic T
that is a ratio of quadratic forms involving the
vector of s_i
and the matrix of normal kernel weights. Although
nonparametric in its method of fitting the possible heteroskedastic
relationship, the distributional approximation used to compute
p
-values assumes normality of the errors.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Diblasi A, Bowman A (1997). “Testing for Constant Variance in a Linear Model.” Statistics & Probability Letters, 33, 95–103.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
diblasi_bowman(mtcars_lm)
diblasi_bowman(mtcars_lm, ignorecov = FALSE)
diblasi_bowman(mtcars_lm, distmethod = "bootstrap")