Skip to content

Robust White test with bootstrap and effect sizes

Source: R/robust_implementations.R · Help: ?performWhiteTestRobust

Extends performWhiteTest() with optional bootstrap resampling, confidence intervals, effect size reporting, and power analysis.

Usage

performWhiteTestRobust(
  model,
  data = NULL,
  method = c("standard", "reduced"),
  bootstrap = FALSE,
  B = 999,
  ci_level = 0.95,
  parallel = FALSE
)

Arguments

model
A fitted stats::lm object representing the mean specification to be diagnosed.
data
A base::data.frame (or object coercible to one) containing the variables referenced by model. It must include the observations used to fit model and will be checked for missing values. When NULL, the default, the model frame of model is used. It holds the terms of the model rather than its variables (log(x) rather than x), so a model that transforms a variable needs data, as does a model with an offset() term, and so may a fit whose weights or offset argument is a column of the data, which the model frame holds as (weights) or (offset).
method
Character string selecting the auxiliary specification. "standard" retains squares and cross-products, while "reduced" excludes cross-products for high-dimensional designs.
bootstrap
Logical, compute bootstrap diagnostics for the statistic and p-value? The bootstrap is bootstrapTestStatistic(), so on a fit returned by fitWLS() each replicate estimates the weights again, its default since 0.15.0. There is no argument to hold them fixed here; bootstrapTestStatistic() with reestimate_weights = FALSE does that.
B
Number of bootstrap replications when bootstrap = TRUE. Defaults to 999, at which a bootstrap p-value of the form (1 + #) / (B + 1) gives an exact test at the 5% and 1% levels; it was 1000 before 0.15.0. The value is recorded in robust_details$bootstrap$B whether or not the bootstrap runs.
ci_level
Confidence level for reported intervals.
parallel
Logical, allow parallel bootstrap evaluation when the parallel package is available. A seeded call gives the same result each time; see Parallel replicates in bootstrapTestStatistic().

Value

An object of class htest augmented with a robust_details list containing bootstrap, effect size, and power information.

Details

Provides enriched inference around the White test by combining bootstrap resampling (Efron & Tibshirani, 1993) with asymptotic approximations. The robust_details element summarises interval estimates, effect sizes, and power calculations to aid decision-making.

References

White, H. (1980). A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroscedasticity. Econometrica, 48(4), 817–838.

Efron, B., & Tibshirani, R. J. (1993). An Introduction to the Bootstrap. Chapman & Hall.

See also

performWhiteTest() for the base statistic and performWhiteTestBootstrap() for a lighter-weight resampling option.

Examples

data(mtcars)
mod <- lm(mpg ~ wt + qsec, data = mtcars)
performWhiteTestRobust(mod, mtcars, bootstrap = TRUE, B = 200)