linear_combination {probstats4econ}R Documentation

Test a single linear restriction of a model

Description

linear_combination takes a set of regression results and a vector representing a linear combination of the parameters and returns the estimate, standard error, and p-value for the null hypothesis that the linear combination is equal to zero.

Usage

linear_combination(regresults, R)

Arguments

regresults

A list containing two items: coefficients, which is a vector of coefficient estimates, and vcov, which is the variance-covariance matrix of the coefficient estimates.

R

A vector of length equal to the number of coefficients, representing weights on each of the parameters.

Value

List with the following values:

Examples


# test that the returns to one year of education are equal to ten years of age
model <- estimatr::lm_robust(earnwk ~ age + educ, data = cps)
R <- c(0, -10, 1) # 0 * `intercept` - 10 * `age` + 1 * `education`
linear_combination(model, R)


[Package probstats4econ version 0.2.0 Index]