Skip to contents

Source: the reference implementation CLR in the CRAN package ivmodel (file R/CLR.r), implementing Moreira, M. J. (2003), Econometrica 71, 1027-1048, with the conditional p-value integral of Andrews, Moreira and Stock (2007), Journal of Econometrics 138, 46-81; Kleibergen, F. (2002), Econometrica 70, 1781-1803, supplies the score decomposition. With P_Z the projection on the partialled-out instruments and sigmaHat = crossprod(M_Z [Y D]) / (n - k - L), a0 = (beta0, 1), b0 = (1, -beta0): \(QS = ||P_Z [Y D] b0||^2 / (b0' sigmaHat b0)\), \(QT = ||P_Z [Y D] sigmaHat^-1 a0||^2 / (a0' sigmaHat^-1 a0)\), QTS the corresponding normalised cross term, and LR = (QS - QT + sqrt((QS+QT)^2 - 4(QS QT - QTS^2)))/2.

Usage

Ivclr(y, X, Z, beta0 = 0, X_exog = NULL, add_intercept = TRUE)

Arguments

y

Numeric outcome of length n.

X

Numeric endogenous regressor of length n.

Z

Numeric n x L matrix of instruments.

beta0

Null value of the structural coefficient. Default 0.

X_exog

Optional n x q matrix of included exogenous covariates.

add_intercept

Include an intercept. Default TRUE.

Value

list: statistic, p_value, QS, QT, QTS, beta0, n, n_instruments, df2, method.

Details

For L = 1 the conditional p-value is 1 - pf(LR, 1, df2). For L >= 2 the package source integrates 2 K int_0^1 pchisq((QT+LR)/(1 + QT x^2/LR), L) (1-x^2)^((L-3)/2) dx with K = gamma(L/2)/(sqrt(pi) gamma((L-1)/2)); the substitution x = sin(theta) used here turns that into \(2 K int_0^{pi/2} pchisq((QT+LR)/(1 + QT sin^2(theta)/LR), L) cos^(L-2)(theta) dtheta\), whose integrand is bounded and smooth for every L >= 2, so the epsilon-regularised L = 4 special case in the package is not needed. A fixed 4096-interval composite Simpson rule is used, so the result is deterministic.

Examples

set.seed(1)
Z <- matrix(rnorm(120), 60, 2)
D <- Z %*% c(1, 0.5) + rnorm(60)
Ivclr(1.5 * D + rnorm(60), D, Z, 1.5)$p_value
#> [1] 0.4819106