Learn R Programming

whitestrap (version 0.0.1)

white_test_boot: Bootstrapped version of the White's test (Jeong, J., Lee, K. (1999))

Description

This is a versioned White's test based on a bootstrap procedure that can improve the performance of White<U+2019>s test, specially in small samples. It was proposed by Jeong, J., Lee, K. (1999) (see references for further details).

Usage

white_test_boot(model, bootstraps = 1000)

Arguments

model

An object of class lm

bootstraps

Number of bootstrap to be performed. If `bootstraps` is less than 10, it will automatically be set to 10. At least 500 simulations are recommended. Default value is set to 1000.

Value

A list with class white_test containing:

w_stat The value of the test statistic
p_value The p-value of the test
iters The number of bootstrap samples

Details

The bootstrapped error term is defined by:

$$\widehat{u_i} = \sigma^2 * t_i^{*} (i = 1,...N)$$

where \(t_i^{*}\) follows a distribution satisfying \(E(t) = 0\) and \(var(t) = I\).

In particular, the selected distribution of \(t\) can be found at the bottom of page 196 at Handbook of Computational Econometrics (2009).

References

Jeong, J., & Lee, K. (1999). Bootstrapped White<U+2019>s test for heteroskedasticity in regression models. Economics Letters, 63(3), 261-267.

White, H. (1980). A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity. Econometrica, 48(4), 817-838.

Wooldridge, Jeffrey M., 1960-. (2012). Introductory econometrics : a modern approach. Mason, Ohio : South-Western Cengage Learning,

Examples

Run this code
# NOT RUN {
# Define a dataframe with heteroscedasticity
n <- 100
y <- 1:n
sd <- runif(n, min = 0, max = 4)
error <- rnorm(n, 0, sd*y)
X <- y + error
df <- data.frame(y, X)
# OLS model
fit <- lm(y ~ X, data = df)
# White's test
white_test_boot(fit)

# }

Run the code above in your browser using DataLab