collect_par {bate} | R Documentation |
Collect parameters from the short, intermediate and auxiliary regressions
collect_par(data, outcome, treatment, control, other_regressors = NULL)
data |
A data frame. |
outcome |
The name of the outcome variable (must be present in the data frame). |
treatment |
The name of the treatment variable (must be present in the data frame). |
control |
Control variables to be added to the intermediate regression. |
other_regressors |
Subset of control variables to be added in the short regression (default is NULL). |
A data frame with the following columns:
beta0 |
Treatment effect in the short regression |
R0 |
R-squared in the short regression |
betatilde |
Treatment effect in the intermediate regression |
Rtilde |
R-squared in the intermediate regression |
sigmay |
Standard deviation of outcome variable |
sigmax |
Standard deviation of treatment variable |
taux |
Standard deviation of residual in auxiliary regression |
## Load data set
data("NLSY_IQ")
## Set age and race as factor variables
NLSY_IQ$age <- factor(NLSY_IQ$age)
NLSY_IQ$race <- factor(NLSY_IQ$race)
## Collect parameters from the short, intermediate and auxiliary regressions
parameters <- collect_par(
data = NLSY_IQ, outcome = "iq_std",
treatment = "BF_months",
control = c("age","sex","income","motherAge","motherEDU","mom_married","race"),
other_regressors = c("sex","age"))
## See results
(parameters)