*! version 1.0.0 15oct2021

Title

ebreg -- Robust Empirical Bayes Confidence Intervals

Syntax

ebreg depvar [indepvars] [if] [in] , se(se_var) [options]

weights(wgt_var) An optional numeric vector of weights to be used in the fitting process in computing delta, mu_2 and kappa.

alpha(#) Determines confidence level, 1-alpha. Default is alpha=0.05.

kappa(#) If specified, use this value for the kurtosis kappa of theta-X*delta (such as setting it to infinity), instead of computing it.

wopt Compute length-optimal robust robust empirical Bayes confidence intervals (EBCIs).
These are robust EBCIs centered at estimates with the shrinkage factor chosen to minimize the length of the resulting EBCI.

fs_correction() Finite-sample correction method used to compute mu_2 and kappa.
These corrections ensure that we do not shrink the preliminary estimates (as specified by depvar) all the way to the regression line.
If "PMT", use posterior mean truncation, if "FPLIB" use limited information Bayesian approach with a flat prior,
and if "none", truncate the estimate of mu_2 at 0 and the estimate of kappa at 1. Default is "PMT".

reg_options(#) Passes options into Stata's default regression.

approx Use a polynomial approximation to the critical value (for faster computation), rather than computing it exactly. Assumes alpha=0.05. User-specified option for alpha is ignored.

genvar(ebci) Store ebreg output as variables using prefix ebci_*. The stored output vectors are described below.

se() must be specified. They are standard errors sigma associated with the preliminary estimates as specified by depvar.

Description

This Stata package implements robust empirical Bayes confidence intervals from Armstrong, Kolesár, and Plagborg-Møller (2021) by shrinking preliminary estimates toward a regression line.

Examples

. use cz, clear

. gen wgt = 1/se25^2

. ebreg theta25 stayer25, se(se25) weights(wgt) alpha(0.1) genvar(ebci)

. summarize ebci_*

Stored results

ebreg stores the following in e():

Scalars

e(mu2) Estimated second moment of theta-X*delta, mu_2, computed using the finite-sample correction as specified by fs_correction.

e(mu2_uncorrected) Estimated second moment of theta-X*delta, mu_2 without a finite-sample correction.

e(kappa) Estimated kurtosis kappa of theta-X*delta, computed using the finite-sample correction as specified by fs_correction.

e(kappa_uncorrected) Estimated kurtosis kappa of theta-X*delta without a finite-sample correction.

Matrices

e(th_op) Vector of estimates based on length-optimal shrinkage.

e(th_eb) Vector of empirical Bayes estimates.

e(th_us) Vector of unshrunk estimates (as specified by depvar).

e(ciu_us) Vector of upper endpoints of unshrunk CI.

e(cil_us) Vector of lower endpoints of unshrunk CI.

e(ciu_pa) Vector of upper endpoints of parametric EBCIs.

e(cil_pa) Vector of lower endpoints of parametric EBCIs.

e(ciu_op) Vector of upper endpoints of robust EBCIs based on length-optimal shrinkage.

e(cil_op) Vector of lower endpoints of robust EBCIs based on length-optimal shrinkage.

e(ciu_eb) Vector of upper endpoints of robust EBCIs.

e(cil_eb) Vector of lower endpoints of robust EBCIs.

e(len_us) Vector of half-lengths of unshrunk CIs.

e(len_pa) Vector of half-lengths of parametric EBCIs.

e(len_op) Vector of half-lengths of robust EBCIs based on length-optimal shrinkage.

e(len_eb) Vector of half-lengths of robust EBCIs.

e(ncov_pa) Vector of maximal non-coverages of parametric EBCIs.

e(w_opt) Vector of length-optimal shrinkage factors.

e(w_eb) Vector of empirical Bayes shrinkage factors, mu_2/(mu_2+sigma^2_i).

e(EB_df) Matrix of all ebreg output.

Authors

Timothy Armstrong

University of Southern California

Michal Kolesár

Princeton University

Mikkel Plagborg-Møller

Princeton University

Luther Yap

Princeton University

References

Armstrong, Timothy B., Kolesár, Michal, and Plagborg-Møller, Mikkel (2021): Robust Empirical Bayes Confidence Intervals, https://arxiv.org/abs/2004.03448

You can find a MATLAB version of this command at https://github.com/mikkelpm/ebci_matlab, and an R version at https://github.com/kolesarm/ebci