help for causalrep ols

Title

causalrep ols -- Quantifying the internal validity and representativeness of the
OLS estimand

Syntax

causalrep ols
indepvars
[if] [in],
treatment(varname) [options]

Required
treatment(varname) specify a treatment variable coded 0 for untreated observations
and 1 for treated observations

Optional
outcome(varname) specify an outcome variable; if omitted, no outcome regression
is estimated

tmodel(string) specify the model for the propensity score; regress (linear
probability model), logit, and probit are allowed; in principle, only regress
is supported by theory; default is regress

cate(varname) specify a variable that stores the values of the conditional
average treatment effect (CATE) function; cate() requires outcome() to be specified

noisily display the outcome-regression results when outcome() is specified

vce(vcetype) specify the variance estimator for the OLS outcome regression; vcetype
may be ols, robust, cluster clustvar, bootstrap, jackknife,
hc2, or hc3; vce() is relevant only when outcome() is specified; default
is robust

Description

causalrep ols estimates the measure of internal validity (MIV) of the OLS
estimand, as proposed by Poirier and Słoczyński (2026). Under unconfoundedness and
when the propensity score lies in the linear span of the included controls, this
estimand can be written as a weighted average of conditional average treatment
effects, with weights proportional to the conditional variance of treatment.

When the CATE function is unrestricted and the weights are nonnegative, the MIV equals the
inverse maximum weight. It is the largest possible share of the population for which the
OLS estimand can be represented as an average treatment effect. Because the target
population for causalrep ols is the entire population, the MIV also equals
the measure of representativeness.

When negative estimated weights are detected, the value reported as MIV when the CATE function
is unrestricted is the inverse maximum weight. If any population weights are negative, the
unrestricted-CATE MIV and MR are zero. See Poirier and Słoczyński (2026) for details.

If outcome() is omitted, the command estimates this measure using only the treatment
and control variables. If outcome() is specified, the command also estimates the OLS
coefficient and posts its coefficient vector and variance–covariance matrix.

If cate() is specified, the command additionally computes the largest share of the
sample whose mean supplied CATE equals the estimated OLS coefficient. The supplied CATE
values are treated as fixed, and their estimation uncertainty is not incorporated. They are
required to be nonmissing for every observation in the estimation sample.

outcome() is required when cate() is specified because the CATE-based calculation
compares the supplied CATE values with the estimated OLS coefficient.

If the OLS estimate lies outside the range of the supplied CATE values, the CATE-based MIV is
zero. If the OLS estimate equals the mean supplied CATE, the CATE-based MIV is one. The
CATE-based MIV can be positive even when the unrestricted-CATE measure is zero.

This is a companion software package for Poirier and Słoczyński (2026). Please cite this paper
if you use causalrep ols in your work.

References

Poirier, Alexandre, and Tymon Słoczyński (2026). "Quantifying the Internal Validity
of Weighted Estimands." arXiv preprint arXiv:2404.14603. Available at https://arxiv.org/abs/2404.14603.

Examples

Load data from LaLonde (1986):

. use https://tslocz.github.io/lalonde.dta, clear

Keep only the original experimental data:

. keep if dataset==0

Estimate the MIV of the OLS estimand:

. causalrep ols age educ black hispanic married nodegree re74 re75, t(treated)

Estimate the CATE function using teffects aipw:

. teffects aipw (re78 age educ black hispanic married nodegree re74 re75) (treated age educ black hispanic married nodegree re74 re75)

. predict double cate, te

Estimate the MIV of the OLS estimand, including conditional on the estimated CATE values:

. causalrep ols age educ black hispanic married nodegree re74 re75, t(treated) o(re78) cate(cate)

Display stored estimation results:

. ereturn list

Stored results

causalrep ols stores the following in e():

Always stored

e(N) number of observations

e(miv) estimate of the inverse maximum weight; this is the MIV when the CATE function is unrestricted and the weights are nonnegative

e(cmdline) command line

e(cmd) causalrep

e(subcmd) ols

e(sample) marks estimation sample

Only when outcome() is specified

e(ols) estimated coefficient on the treatment variable in the OLS regression

e(depvar) name of dependent (outcome) variable

e(b) estimated coefficient vector, as obtained by regress

e(V) estimated variance–covariance matrix, as obtained by regress

e(df_r) residual degrees of freedom, as obtained by regress

Only when cate() is specified

e(ate) mean of the supplied CATE values over the estimation sample

e(miv_cate) estimate of the MIV conditional on the supplied CATE values

License

This package is licensed under the MIT License. See the LICENSE
file included with the distribution.

Authors

Alexandre Poirier, Georgetown University

Email: alexandre.poirier@georgetown.edu

Tymon Słoczyński, Brandeis University

Email: tslocz@brandeis.edu