Description Usage Arguments Details Value Author(s) References Examples
Computes diagnostics for linear regression when treatment effects are heterogeneous.
1  hettreatreg(outcome, treatment, covariates, verbose = FALSE)

outcome 
the outcome variable. 
treatment 
the treatment variable. The variable must be binary and coded 0 for the untreated units and 1 for the treated units. 
covariates 
the list of control variables. The list must not include the treatment variable. 
verbose 
logical. If 
hettreatreg
represents ordinary least squares (OLS) estimates of the effect of a binary treatment as a weighted average of the average treatment effect on the treated (ATT) and the average treatment effect on the untreated (ATU). The program estimates the OLS weights on these parameters, computes the associated model diagnostics, and reports the implicit OLS estimate of the average treatment effect (ATE). See Sloczynski (2019) for the underlying theoretical results and further details.
The arguments outcome
and treatment
are used to designate an outcome variable and a treatment variable, respectively. The treatment variable must be binary and coded 0 for the untreated units and 1 for the treated units. covariates
is a list of control variables that must not include the treatment variable.
hettreatreg
displays a number of statistics. OLS
is the estimated regression coefficient on the treatment variable. P(d=1)
and P(d=0)
are the sample proportions of treated and untreated units, respectively. w1
and w0
are the OLS weights on ATT and ATU, respectively. delta
is a diagnostic for interpreting OLS as ATE. ATE
, ATT
, and ATU
are the implicit OLS estimates of the corresponding parameters. See Sloczynski (2019) for further details.
If you use this program in your work, please cite Sloczynski (2019).

OLS estimate of the treatment effect 

proportion of treated units 

proportion of untreated units 

OLS weight on ATT 

OLS weight on ATU 

diagnostic for interpreting OLS as ATE 

implicit OLS estimate of ATE 

implicit OLS estimate of ATT 

implicit OLS estimate of ATU 
Tymon Sloczynski, Brandeis University, tslocz@brandeis.edu, http://people.brandeis.edu/~tslocz/
Maintained by: Mark McAvoy, Brandeis University, mcavoy@brandeis.edu
Please feel free to report bugs and share your comments on this program.
Sloczynski, Tymon (2019). "Interpreting OLS Estimands When Treatment Effects Are Heterogeneous: Smaller Groups Get Larger Weights." Available at http://people.brandeis.edu/~tslocz/Sloczynski_paper_regression.pdf.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  # load package
library(hettreatreg)
# read in data
data("nswcps")
# save the outcome variable
outcome < nswcps$re78
# save the treatment variable
treated < nswcps$treated
# select control variables
our_vars < c("age", "age2", "educ", "black", "hispanic", "married", "nodegree")
covariates < subset(nswcps, select = our_vars)
# run function
results < hettreatreg(outcome, treated, covariates)
print(results)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.