wald_test: Wald test. Tests restrictions*coefficients = value.

Description Usage Arguments Value Examples

View source: R/test_functions.R

Description

Wald test. Tests restrictions*coefficients = value.

Usage

1
2
3
4
5
6
7
8
wald_test(
  model,
  restrictions,
  value,
  robust = FALSE,
  vcov = NULL,
  quantiles = c(0.9, 0.95, 0.99)
)

Arguments

model

Model compatible with 'fitted' and 'residuals' functions.

restrictions

Matrix of size (number of restrictions) times length(coefficients), for free restrictions use zeros.

value

Values of restrictions.

robust

Use robust 'varcov' matrix.

vcov

Particular variance and covariances matrix.

quantiles

Vector of quantiles to calculate pvalues.

Value

A 'tibbble' with the Wald value, the corresponding pvalue and the quantiles of the distribution.

Examples

1
2
3
4
5
6
7
8
9
x <- 1:10
z <- x**2
y <- 1:10
model <- lm(y~x+z)
restrictions <- diag(3)
value <-  as.matrix(c(0, 0, 0))
w_test <- wald_test(model, restrictions, value)
w_test <- wald_test(model, restrictions, value, robust = TRUE)
w_test <- wald_test(model, restrictions, value, quantiles = c(.97))

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