View source: R/linear_combination.R
linear_combination | R Documentation |
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.
linear_combination(regresults, R)
regresults |
A list containing two items: |
R |
A vector of length equal to the number of coefficients, representing weights on each of the parameters. |
List with the following values:
estimate
, the point estimate of the linear combination
se
, the standard error of the point estimate
p_value
, the p-value for the null hypothesis that the
linear combination is equal to zero
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.