Test a single linear restriction of a model
linear_combination.Rd
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.
Value
List with the following values:
estimate
, the point estimate of the linear combinationse
, the standard error of the point estimatep_value
, the p-value for the null hypothesis that the linear combination is equal to zero
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)
#> $estimate
#> [1] 59.68426
#>
#> $se
#> [1] 15.37938
#>
#> $p_value
#> [1] 0.0001041142
#>