collect_par function

Collect parameters from the short, intermediate and auxiliary regressions

Collect parameters from the short, intermediate and auxiliary regressions

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).

Returns

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)
  • Maintainer: Deepankar Basu
  • License: MIT + file LICENSE
  • Last published: 2022-03-28