drop_test: Wald test for the exclusion of regressors

Description Usage Arguments Value Examples

View source: R/drop_test.R

Description

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()).

Usage

1
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 χ^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

1
2
3
4
5
6
7
8
9
data("hprice1")

mod <- lm(price ~ sqrft + bdrms + colonial, data = hprice1)

# Heteroskedasticity-robust joint significance test
drop_test(mod, vce = "HC")

# Test that bdrms and colonial are redundant (heteroskedasticity robust)
drop_test(mod, ~ bdrms + colonial, vce = "HC")

jcpernias/ec1027 documentation built on Dec. 20, 2021, 10:03 p.m.