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)
model | an estimated model returned by |
---|---|
frml | an one-sided formula specifying the terms to be tested.
If |
vce | an object indicating how to obtain the covariance matrix. |
chisq | if |
An object of class htest
with components:
the value of the test statistic.
the p-value of the test.
degrees of freedom.
a character string indicating what type of test was performed.
a character string describing the model.
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 #>