Christian Hansen’s Research Page

 

Code for IVQR

 

Below are links to MATLAB and Ox code for performing IVQR estimation and inference as developed in “Instrumental Quantile Regression Inference for Structural and Treatment Effect Models” (with Victor Chernozhukov) and “Instrumental Variable Quantile Regression” (with Victor Chernozhukov).  Along with the code, each file contains examples illustrating how the code may be implemented; the data for the examples may also be downloaded below.

 

1.  MATLAB Code             

2.  Ox Code                          

3.  Data for examples

 

4.  Stata Code contributed by Do Wan Kwak (kwakdo@msu.edu)

 

Code for Weak Instrument Robust Inference

 

Below are links for the Stata code and data used in the empirical example in “A Simple Approach to Heteroskedasticity and Autocorrelation Robust Inference with Weak Instruments” (with Victor Chernozhukov).  The data are taken from Acemoglu, Johnson, and Robinson (2001) “The Colonial Origins of Comparative Development: An Empirical Investigation”.  The code illustrates the basic procedure and may easily be modified for other data sets and to provide inference that is robust to autocorrelation or clustering.

 

I thank Mel Stephens for noticing a small error in the original code that has been corrected.  Due to this correction, the results produced by running the files given below will differ slightly from those in the published paper.

 

1.  Stata Code for weak instrument robust inference

2.  Data

 

Code for Finite Sample Inference for Quantile Regression

 

Below is a link to MATLAB code used to produce the results in Table 1 and Figure 1 in Chernozhukov, Hansen, and Jansson (2009) “Finite Sample Inference in Econometric Models via Quantile Restrictions.” 

 

1.  MATLAB code for finite sample inference for quantile regression

 

Code for Sensitivity Analysis for IV (from “Plausibly Exogenous”)

 

Below are links for Stata code that produces some of the results from “Plausibly Exogenous” (with Tim Conley and Peter Rossi).  The code illustrates the basic procedure and may easily be modified for other data sets.  The file with the Stata code also includes sample data.

 

1.  Stata Code for IV sensitivity analysis

 

 

Working Papers

Only unpublished work appears here.  A complete list of research including publications may be found on my CV.

 

1.  Plausibly Exogenous” (with Timothy Conley and Peter Rossi, forthcoming Review of Economics and Statistics)

2.  Bias Reduction for Bayesian and Frequentist Estimators” (with C. Alan Bester)

3.  Inference with Dependent Data Using Cluster Covariance Estimators” (with C. Alan Bester and Timothy Conley, forthcoming Journal of Econometrics)

4.  Fixed-b Asymptotics for Spatially Dependent Robust Nonparametric Covariance Matrix Estimators” (with C. Alan Bester, Timothy Conley, and Timothy Vogelsang)

5.  Flexible Correlated Random Effects Estimation in Panel Models with Unobserved Heterogeneity” (with C. Alan Bester)

6.  Grouped Effects Estimators in Fixed Effects Models” (with C. Alan Bester)

7.  Lasso Methods for Gaussian Instrumental Variables Models” (with A. Belloni and V. Chernzhukov)

8.  Sparse Models and Methods for Optimal Instruments with an Application to Eminent Domain” (with A. Belloni, D. Chen, and V. Chernzhukov)

 

Other Material

 

Technical Appendix for “Generalized Least Squares Inference in Panel and Multilevel Models with Serial Correlation and Fixed Effects” Journal of Econometrics (October 2007).

Technical Appendix for “Asymptotic Properties of a Robust Variance Matrix Estimator for Panel Data when T is Large” Journal of Econometrics (December 2007).

Derivation of F-statistic Result for “Asymptotic Properties of a Robust Variance Matrix Estimator for Panel Data when T is Large” Journal of Econometrics (December 2007) contributed by Mark Watson and James Stock.  I am deeply indebted to Stock and Watson for pointing this result out to me that they established while working on their paper “Heteroskedasticity-Robust Standard Errors for Fixed Effect Panel Data Regression” (Econometrica, 2008).  I am also embarrassed that a citation to their paper does not appear in the published version of my paper.

Working paper version of "The Reduced Form: A Simple Approach to Inference with Weak Instruments" (with Victor Chernozhukov, published as “The reduced form: A simple approach to inference with weak instruments” Economics Letters, July 2008) with additional tables and discussion excluded from published version.         

 

Abstract for Working Papers

 

 Plausibly Exogenous” (with Timothy Conley and Peter Rossi, forthcoming Review of Economics and Statistics)

 

Instrumental variables (IVs) are widely used to identify effects in models with potentially endogenous explanatory variables. In many cases, the instrument exclusion restriction that underlies the validity of the usual IV inference holds only approximately; that is, the instruments are ‘plausibly exogenous.’ We introduce a method of relaxing the exclusion restriction and performing sensitivity analysis with respect to the degree of violation. This provides practical tools for applied researchers who want to proceed with less-than-perfect instruments. We illustrate our approach with empirical examples that examine the effect of 401(k) participation upon asset accumulation, demand for margarine, and returns-to-schooling.

 

 

 Bias Reduction for Bayesian and Frequentist Estimators” (with C. Alan Bester)

 

                We show that in parametric likelihood models the first order bias in the posterior mode and the posterior mean can be removed using objective Bayesian priors.  These bias-reducing priors are defined as the solution to a set of differential equations which may not be available in closed form.  We provide a simple and tractable data dependent prior that solves the differential equations asymptotically and removes the first order bias.  When we consider the posterior mode, this approach can be interpreted as penalized maximum likelihood in a frequentist setting.  We illustrate the construction and use of the bias-reducing priors in simple examples and a simulation study.

 

 

 Inference with Dependent Data Using Cluster Covariance Estimators” (with C. Alan Bester and Timothy Conley)

 

This paper presents a novel way to conduct inference using dependent data in time series, spatial, and panel data applications. Our method involves constructing t and Wald statistics utilizing a cluster covariance matrix estimator (CCE). We then use an approximation that takes the number of clusters/groups as fixed and the number of observations per group to be large and calculate limiting distributions of the t and Wald statistics. This approximation is analogous to `fixed-b' asymptotics of Kiefer and Vogelsang (2002, 2005) (KV) for heteroskedasticity and autocorrelation consistent inference, but in our case yields standard t and F distributions where the number of groups essentially plays the role of sample size. We provide simulation evidence that demonstrates our procedure outperforms conventional inference procedures and performs comparably to KV.

 

 

Fixed-b Asymptotics for Spatially Dependent Robust Nonparametric Covariance Matrix Estimators” (with C. Alan Bester, Timothy Conley, and Timothy Vogelsang)

 

                This paper develops a method for performing inference using spatially dependent data. We consider test statistics formed using nonparametric covariance matrix estimators that account for heteroskedasticity and spatial correlation (spatial HAC). We provide distributions of commonly used test statistics under “fixed-b" asymptotics, in which HAC smoothing parameters are proportional to the sample size. Under this sequence, spatial HAC estimators are not consistent but converge to non-degenerate limiting random variables that depend on the HAC smoothing parameters and kernel. We show that the limit distributions of commonly used test statistics are pivotal but non-standard, so critical values must be obtained by simulation. We provide a simple and general simulation procedure based on the i.i.d. bootstrap that can be used to obtain critical values. We illustrate the potential gains of the new approximation through simulations and an empirical example that examines the effect of unjust dismissal doctrine on temporary help services employment.

 

 

Flexible Correlated Random Effects Estimation in Panel Models with Unobserved Heterogeneity” (with C. Alan Bester)

 

                In this paper, we consider identification in a correlated random effects model for panel data. We assume that the likelihood for each individual in the panel is known up to a finite dimensional common parameter and an individual specific parameter. We allow the distribution of unobserved individual specific effects to depend on observed explanatory variables and make no assumptions about the particular functional form of this dependence.  This leads to a semiparametric problem where the parameters include a finite dimensional common parameter, θ and an infinite dimensional conditional density, q, that describes the distribution of unobserved individual specific effects. For a given likelihood, we establish restrictions on the space of functions H for the distribution of unobserved heterogeneity under which {θ,q} are identified. We show the model parameters may be consistently estimated by sieve maximum likelihood for a fixed panel length, T. The conditions on H, which include assumptions about the support of explanatory variables and smoothness of q in its arguments, are relatively mild and are similar to those required for nonparametric density estimation.

 

 

Grouped Effects Estimators in Fixed Effects Models” (with C. Alan Bester)

 

We consider estimation of nonlinear panel data models with common and individual specific parameters.  Fixed effects estimators are known to suffer from the incidental parameters problem, which can lead to large biases in estimates of common parameters. Pooled estimators, which ignore heterogeneity across individuals, are also generally inconsistent. We assume that individuals in our data are grouped on multiple levels. These groups may be based on some external classification (for example, SIC codes), geographic location (census tract, county, state, etc.), or perhaps based on observable right hand side variables, and may be nested (hierarchical) or non-nested. We consider “group effects" estimators, where individual specific parameters are assumed common across groups at some level. We provide conditions under which group effects estimates of common parameters are asymptotically unbiased and normal. Our conditions suggest a tradeoff between two sources of bias, one due to incidental parameters and the other due to misspecification of unobserved heterogeneity. Our findings suggest that one may wish to control for heterogeneity at the group level even when individual specific effects are present. These findings are confirmed in a Monte Carlo study and illustrated in two empirical examples.

 

 

Lasso Methods for Gaussian Instrumental Variables Models” (with A. Belloni and V. Chernzhukov)

 

In this note, we propose to use sparse methods (e.g. LASSO, Post-LASSO, , and Post-) to form first-stage predictions and estimate optimal instruments in linear instrumental variables (IV) models with many instruments, p, in the canonical Gaussian case. The methods apply even when p is much larger than the sample size, n. We derive asymptotic distributions for the resulting IV estimators and provide conditions under which these sparsity-based IV estimators are asymptotically oracle-efficient.  In simulation experiments, a sparsity-based IV estimator with a data-driven penalty performs well compared to recently advocated many-instrument-robust procedures. We illustrate the procedure in an empirical example using the Angrist and Krueger (1991) schooling data.

 

 

Sparse Models and Methods for Optimal Instruments with an Application to Eminent Domain” (with A. Belloni, D. Chen, and V. Chernzhukov)

 

We develop results for the use of LASSO and Post-LASSO methods to form first-stage predictions and estimate optimal instruments in linear instrumental variables (IV) models with many instruments, p, that apply even when p is much larger than the sample size, n. We rigorously develop asymptotic distribution and inference theory for the resulting IV estimators and provide conditions under which these estimators are asymptotically oracle-efficient. In simulation experiments, the LASSO-based IV estimator with a data-driven penalty performs well compared to recently advocated many-instrument-robust procedures. In an empirical example dealing with the effect of judicial eminent domain decisions on economic outcomes, the LASSO-based IV estimator substantially reduces estimated standard errors allowing one to draw much more precise conclusions about the economic effects of these decisions. 

Optimal instruments are conditional expectations; and in developing the IV results, we also establish a series of new results for LASSO and Post-LASSO estimators of non-parametric conditional expectation functions which are of independent theoretical and practical interest.  Specifically, we develop the asymptotic theory for these estimators that allows for non-Gaussian, heteroscedastic disturbances, which is important for econometric applications. By innovatively using moderate deviation theory for self-normalized sums, we provide convergence rates for these estimators that are as sharp as in the homoscedastic Gaussian case under the weak condition that log p = o(n1/3). Moreover, as a practical innovation, we provide a fully data-driven method for choosing the user-specified penalty that must be provided in obtaining LASSO and Post-LASSO estimates and establish its asymptotic validity under non-Gaussian, heteroscedastic disturbances.