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
, where
denotes
expectation under the null hypothesis of homoskedasticity. The kernel
method of nonparametric regression is used to fit the relationship
between these
and the explanatory variables. This leads to a
test statistic
that is a ratio of quadratic forms involving the
vector of
and the matrix of normal kernel weights. Although
nonparametric in its method of fitting the possible heteroskedastic
relationship, the distributional approximation used to compute
-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")