dominguez_lobato_test: Tests the specification of a linear model using...

Description Usage Arguments Value References Examples

View source: R/test_functions.R

Description

Tests the specification of a linear model using wild-bootstrap.

Usage

1
2
3
4
5
6
7
8
9
dominguez_lobato_test(
  model,
  distribution = "rnorm",
  statistic = "cvm_value",
  times = 300,
  quantiles = c(0.9, 0.95, 0.99),
  verbose = FALSE,
  n_cores = 1
)

Arguments

model

An existing fit from a model function such as 'lm', 'lfe' and others compatible with 'update'.

distribution

Type of noise added to residuals, ej 'rnorm' or 'rrademacher'.

statistic

Type of statistic to be used, can be one of 'cvm_value' or 'kmv_value'.

times

Number of bootstrap samples.

quantiles

Vector of quantiles to calculate pvalues.

verbose

TRUE to print each bootstrap iteration.

n_cores

Number of cores to be used.

Value

A list with dataframe results and the ordered values of each bootstrap iteration.

References

Manuel A. Dominguez and Ignacio N. Lobato (2019). Specification Testing with Estimated Variables. Econometric Reviews.

Examples

1
2
3
4
5
6
x <- 1:10 + rnorm(10)
y <- 1:10
model <- lm(y~x)
dl_test <- dominguez_lobato_test(model)
dl_test <- dominguez_lobato_test(model, distribution = "rmammen_point", statistic = "kmv_value")
dl_test <- dominguez_lobato_test(model, times = 100)

FedericoGarza/lineartestr documentation built on Jan. 31, 2021, 11:11 a.m.