Test that variables in frml can be excluded from model using a Wald test. The parameter vce determines how is computed the covariance matrix of the model parameters (see se()).

drop_test(model, frml = NULL, vce = NULL, chisq = FALSE)

Arguments

model

an estimated model returned by lm or similar functions.

frml

an one-sided formula specifying the terms to be tested. If NULL all of the model regressors are used.

vce

an object indicating how to obtain the covariance matrix.

chisq

if TRUE the \(\chi^2\) version is returned. By default is FALSE and the F version is computed.

Value

An object of class htest with components:

statistic

the value of the test statistic.

p.value

the p-value of the test.

parameter

degrees of freedom.

method

a character string indicating what type of test was performed.

data.name

a character string describing the model.

Examples

data("hprice1") mod <- lm(price ~ sqrft + bdrms + colonial, data = hprice1) # Heteroskedasticity-robust joint significance test drop_test(mod, vce = "HC")
#> #> Wald test for redundant variables #> #> data: Test for redudancy of all covariates. #> #> Call: #> lm(price ~ sqrft + bdrms + colonial, data = hprice1) #> #> Covariance matrix estimate: HC. #> #> #> F = 16.749, df1 = 3, df2 = 84, p-value = 1.289e-08 #>
# Test that bdrms and colonial are redundant (heteroskedasticity robust) drop_test(mod, ~ bdrms + colonial, vce = "HC")
#> #> Wald test for redundant variables #> #> data: Test for redudancy of ~bdrms + colonial. #> #> Call: #> lm(price ~ sqrft + bdrms + colonial, data = hprice1) #> #> Covariance matrix estimate: HC. #> #> #> F = 1.3769, df1 = 2, df2 = 84, p-value = 0.258 #>