*! version 1.0.0 12sep2016

Title

test_sandwich -- Computes Wald-type tests of parameters estimated by reg_sandwich, using a bias-reduced linearization estimator and small-sample corrections to the test statistic and reference distribution.

Syntax

test_sandwich
varlist
[, cons]

Main
cons includes the constant term

test_sandwich uses the supporting mata function
test_sandwich_ftests.mo

* please note that test_sandwich uses the mata workspace for intermediate calculations.
This can potentially cause conflict with existing matrices. This affects matrices named
sq_Omega_Ftest, C_Ftest, D_Ftest, Omega_Ftest, V, b, evals, evecs, matrix_Ftest, z_Ftest
and names of the form X*, PP*, P*_relevant, where * can be any real integer.

see also reg_sandwich

Description

test_sandwich is a post-estimation command to be run after reg_sandwich.
It computes a small-sample corrected Wald test of parameters included in varlist, using the same sample and weights as in the reg_sandwich estimation. The variance-covariance matrix of the parameters is based on on a version of the bias-reduced linearization estimator proposed by Bell and McCaffrey (2002) and further developed by Tipton and Pustejovsky (2015) and Pustejovsky and Tipton (2016). The small sample corrections, termed the "approximate Hotelling's T-squared test" by Pustejovsky and Tipton (2016), involve adjustments to both the Wald test statistic and to the reference distribution. The reference distribution is a multiple of an F distribution with numerator degrees of freedom equal to the number of parameter restrictions and denominator degrees of freedom approximated based on a working model for the variance structure.

Options

Main

cons includes the constant term in the F-test.

Remarks

Parameters included in varlist need to have been estimated by reg_sandwich.

Examples

. use http://masteringmetrics.com/wp-content/uploads/2015/01/deaths.dta

. keep if dtype == 2 & agegr == 2

. xi: reg_sandwich mrate legal beertaxa beerpercap winepercap i.year, cluster(state) absorb(state)

. test_sandwich legal beertaxa

Saved results

test_sandwich saves the following in e():

e(F_stat) F statistic

e(F_df1) degrees of freedom from the numerator

e(F_df1) degrees of freedom from the denominator

e(F_pvalue) p-value of the F statistic

e(F_eta) eta computed for the F statistic

Citation

test_sandwich is not an official Stata command. It is a free contribution to the research community, like a paper.
Please cite it as such:

Tyszler, M., Pustejovsky, J. E., & Tipton, E. 2017. REG_SANDWICH: Stata module to compute cluster-robust (sandwich) variance estimators with small-sample corrections for linear regression, Statistical Software Components S458352, Boston College Department of Economics. URL: https://ideas.repec.org/c/boc/bocode/s458352.html

Authors

Marcelo Tyszler. Sustainable Economic Development and Gender, Royal Tropical Institute, Netherlands. m.tyszler@kit.nl

James E. Pustejovsky (Package maintainer). Department of Education Psychology, University of Texas at Austin. pusto@austin.utexas.edu

Elizabeth Tipton. Department of Human Development, Teachers College, Columbia University. tipton@tc.columbia.edu

References

Pustejovsky, James E. & Elizabeth Tipton (2016).
Small sample methods for cluster-robust variance estimation and hypothesis testing in fixed effects models.
Journal of Business and Economic Statistics. In Press. DOI: 10.1080/07350015.2016.1247004

Elizabeth Tipton and James E. Pustejovsky, 2015. Small-sample adjustments for tests of moderators and model fit
using robust variance estimation in meta-regression. Journal of Educational and Behavioral Statistics December 2015 vol. 40 no. 6 604-634.
DOI: 10.3102/1076998615606099

Bell, R. M., & McCaffrey, D. F. (2002). Bias reduction in standard errors for linear regression with multi-stage samples.
Survey Methodology, 28(2), 169–181.
Retrieved from http://www.statcan.gc.ca/pub/12-001-x/2002002/article/9058-eng.pdf