*! version 2.1 12May2017
help psacalc

Title

psacalc -- Calculate treatment effects and relative degree of selection under proportional selection of observables and
unobservables

Syntax

psacalc
estimate
varname
[,options]

estimate

beta Calculate treatment effect

delta Calculate relative degree of selection

Main
mcontrols(varlist) unrelated controls to be included in all regressions

rmax(#) maximum R-squared; default is rmax=1

model(command) command for model to be estimated when used as stand-alone command

Beta
delta(#) value of delta if requesting calculation of treatment effect beta;
default is delta=1

Delta
beta(#) value of beta if requesting a value of delta to match given beta; default is beta=0

varname may contain factor variables; see fvvarlist.

command is any of the following commands: regress, areg, xtreg.

[if] [in] qualifiers are allowed in command; see if and in.

weights are allowed in command; see weight.

absorb() is required with areg, see [R] absorb.

Only fe and be allowed with xtreg; see [R] xtreg.

Description

psacalc calculates estimates of treatment effects and relative degree of selection in linear models as proposed in
Oster (2016) for a independent variable varname. These estimators are consistent under the assumption of selection on the observed controls
being proportional to the selection on the unobserved controls.

psacalc beta calculates estimates of the treatment effect of varname, beta, to match a proportional degree of selection delta. When there are
multiple solutions, the default is to choose the solution that minimizes the squared difference to the estimated treatment effect in the controlled
regression and does not change the direction of the bias (See Assumption 3 in Oster (2016)).

psacalc delta calculates an estimate of the proportional degree of selection, delta, to match a given treatment effect beta
of varname.

psacalc can be used after regress, areg and xtreg or as a stand-alone command when estimating these linear
models. See Model for details on the assumptions made for each type of model.

Options

Main

mcontrols(varlist) specifies a list of variables to include as controls in all regressions. These variables are assumed to be
unrelated to the set of proportionally related unobservables.

rmax(#) specifies the maximum r-squared which would result if all unobservables were be included in the regression. Default is 1.0.

Beta

delta(#) specifies a value for delta for which the requested treatment effect beta will be calculated. An option
of exactly 1.0 has the interpretation of equal selection.

Delta

beta(#) specifies a value of beta for which the requested proportional degree of selection beta will be calculated. Default is 0.

Model

model specifies a model to be estimated when the command is used as a stand-alone command instead of a post-estimation command.
This option is useful if using when obtaining bootstrap estimates of the standard errors of beta and delta. Three types of models are
supported.

regress for linear cross sectional models.

xtreg, with the fe or be for linear panel data models with fixed effects.
psacalc assumes individual effects are nuisance parameters and calculates estimates using R-squared values from the differenced estimation
equations. See [R] xtreg for details on the differenced equations.

areg for linear regression absorbing one categorical factor. psacalc assumes individual effects are control variables
and calculates estimates using R-squared values from the estimation including indicators for the categorical factor levels.
See [R] areg for details.

Examples

Setup

. sysuse auto.dta, clear

. regress price foreign mpg weight headroom trunk

Obtain value of treatment effect of weight, beta, assuming delta is equal to one, so selection in unobservables is equal to selection on
observables

. psacalc beta weight

Obtain value of treatment effect of weight, beta, assuming delta is equal to 0.5, so selection in unobservables is smaller than
selection on observables

. psacalc beta weight, delta(0.5)

Obtain value of proportional selection, delta, such that the effect of weight is equal to zero

. psacalc delta weight

Obtain value of proportional selection, delta, such that the effect of weight is equal to 5

. psacalc delta weight, beta(5)

Obtain value of proportional selection, delta, such that the effect of weight is equal to 5, assuming foreign is fully observed,
the selection on other controls is proportional to selection in unobservables, and a maximum R-squared of 0.7

. psacalc delta weight, beta(5) rmax(0.7) mcontrol(foreign)

Obtain bootstrap estimates of the standard error of delta with the model option

. bs r(delta), rep(100): psacalc delta weight, model(regress price foreign mpg weight headroom trunk)

Setup for panel data

. webuse nlswork

. xtset idcode

Use after fixed effects model with individual effects taken as nuisance parameters

. xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, fe

. psacalc beta south

Use with individual effects taken as controls

. areg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, absorb(idcode)

. psacalc beta south

Saved Results

psacalc saves the following in r():

Scalars

r(delta) proportional degree of selection

r(beta) treatment effect

Macros

r(cmd) command used for estimation

r(depvar) dependent variable

r(indepvars) independent variables

r(treatment) treatment variable

r(mcontrol) unrelated controls

r(type) type of calculation, beta or delta

psacalc beta saves the following in r():

Scalars

r(dist) squared difference from treatment effect to controlled beta, (beta-beta_tilde)^2

r(root_count) number of solutions

r(altsol1) alternative solution 1

r(altdist1) squared difference of alternative solution 1 to controlled beta

r(altsol2) alternative solution 2

r(altdist2) squared difference of alternative solution 2 to controlled beta

Author

Emily Oster, Brown University

emily_oster@brown.edu

Support

For support and to report bugs please email Jorge Perez, Brown University

jorge_perez@brown.edu

References

Oster, Emily (2016). "Unobservable Selection and Coefficient Stability: Theory and Validation", Journal of Business Economics and Statistics, Forthcoming

Aknowledgements

We are grateful to Danny Cohen-Zada for identifying bugs in a previous version of the command.

Disclaimer

This program is provided without warranty of any kind. The author is not responsible for any cost derived by the usage
of this program.