collect_par {bate} | R Documentation |
Collect parameters from the short, intermediate and auxiliary regressions
Description
Collect parameters from the short, intermediate and auxiliary regressions
Usage
collect_par(data, outcome, treatment, control, other_regressors = NULL)
Arguments
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). |
Value
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 |
Examples
## 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)
[Package bate version 0.1.0 Index]