View source: R/diblasi_bowman.R
diblasi_bowman | R Documentation |
This function implements the nonparametric test of \insertCiteDiblasi97;textualskedastic for testing for heteroskedasticity in a linear regression model.
diblasi_bowman(
mainlm,
distmethod = c("moment.match", "bootstrap"),
H = 0.08,
ignorecov = TRUE,
B = 500L,
seed = 1234,
statonly = FALSE
)
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 |
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.
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.