This function is a wrapper for the function car::linearHypothesis(), but which uses the bain::bain() syntax to parse equality constrained hypotheses.

wald_test(x, hypothesis, ...)

Arguments

x

An object for which a method exists.

hypothesis

A character string with equality constrained hypotheses, specified according to the bain::bain() syntax.

...

Additional arguments passed to car::linearHypothesis().

Value

A data.frame of class wald_test.

See also

Examples

mod <- lm(Sepal.Length ~ Sepal.Width, data = iris)
coef(mod)
#> (Intercept) Sepal.Width 
#>   6.5262226  -0.2233611 
wald_test(mod, "Sepal.Width = 0")
#> Wald chi-square tests for linear hypotheses:
#>     Hypothesis  df    chisq p      NA.    NA..1     NA..2
#>  Sepal.Width=0 148 100.7561 1 1.412238 2.074427 0.1518983