Table of Contents
Fetching ...

Machine-Learning-Powered Specification Testing in Linear Instrumental Variable Models

Cyrill Scheidegger, Malte Londschien, Peter Bühlmann

Abstract

The linear instrumental variable (IV) model is widely used in observational studies, yet its validity hinges on strong assumptions. Classical specification tests such as the Sargan-Hansen J test are limited to overidentified settings and are therefore not applicable in the common just-identified case, where the number of instruments is equal to the number of endogenous variables. We propose a novel test for the well-specification of the linear IV model under the assumption that the structural error is mean independent of the instruments. This assumption enables specification testing even in the just-identified setting. Our approach uses the idea of residual prediction: if the two-stage least squares residuals can be predicted from the instruments better than chance, this indicates misspecification. The resulting test employs sample splitting and a user-chosen machine learning method, and we show asymptotic type I error control and consistency against a broad class of alternatives. We further show how the proposed testing principle can be adapted to settings with weak or many instruments via an Anderson-Rubin-type inversion, thereby substantially extending the applicability. The tests accommodate heteroskedasticity- and cluster-robust inference and are implemented in the R package RPIV and the ivmodels software package for Python.

Machine-Learning-Powered Specification Testing in Linear Instrumental Variable Models

Abstract

The linear instrumental variable (IV) model is widely used in observational studies, yet its validity hinges on strong assumptions. Classical specification tests such as the Sargan-Hansen J test are limited to overidentified settings and are therefore not applicable in the common just-identified case, where the number of instruments is equal to the number of endogenous variables. We propose a novel test for the well-specification of the linear IV model under the assumption that the structural error is mean independent of the instruments. This assumption enables specification testing even in the just-identified setting. Our approach uses the idea of residual prediction: if the two-stage least squares residuals can be predicted from the instruments better than chance, this indicates misspecification. The resulting test employs sample splitting and a user-chosen machine learning method, and we show asymptotic type I error control and consistency against a broad class of alternatives. We further show how the proposed testing principle can be adapted to settings with weak or many instruments via an Anderson-Rubin-type inversion, thereby substantially extending the applicability. The tests accommodate heteroskedasticity- and cluster-robust inference and are implemented in the R package RPIV and the ivmodels software package for Python.

Paper Structure

This paper contains 58 sections, 19 theorems, 164 equations, 26 figures.

Key Result

Theorem 1

Let $N(w)$ and $\hat{\sigma}_w^2$ be defined as in eq_DefNStat and eq_DefHatSigmaW. Let $\zeta>0$ be arbitrary but fixed and assume that Assumptions ass_SigmaMinIID, ass_MomentsIID and ass_Epsilon hold. Then,

Figures (26)

  • Figure 1: Simulation results under $H_0$ with varying $n$. The gray solid line marks $\alpha = 0.05$, the gray dashed lines show pointwise 95% Monte Carlo bounds for rejection rates based on 1000 replications. Dashed curves coincide with same-colored solid curves where not visible.
  • Figure 2: Simulation results under $H_0$ with varying $n_{IV}$. The gray solid line marks $\alpha = 0.05$, the gray dashed lines show pointwise 95% Monte Carlo bounds for rejection rates based on 1000 replications. Dashed curves coincide with same-colored solid curves where not visible.
  • Figure 3: Simulation results under $H_A$ with varying $s_{viol}$. The gray solid line marks $\alpha = 0.05$. Dashed curves coincide with same-colored solid curves where not visible.
  • Figure 4: Simulation results under $H_A$ with varying $\pi$. The gray solid line marks $\alpha = 0.05$. Dashed curves coincide with same-colored solid curves where not visible.
  • Figure 5: P-values for two specifications of the Card dataset as a function of $\beta_0$. Dashed curves coincide with same-colored solid curves where not visible. The gray horizontal line indicates the significance level $\alpha = 0.05$.
  • ...and 21 more figures

Theorems & Definitions (32)

  • Remark 1
  • Remark 2
  • Theorem 1
  • Theorem 2
  • Proposition 1
  • Lemma 1
  • Remark 3
  • Theorem 3
  • Theorem 4
  • Remark 4
  • ...and 22 more