Skip to contents

beta = (X'P_Z X)^-1 X'P_Z y. Identification needs at least as many instruments as regressors (the order condition, arithmetic and checked here) and rank(Z'X) = dim(beta) (the rank condition, which for floating-point data is a matter of degree rather than a decidable property – the degree is what first_stage_F reports).

Usage

morie_caus_iv_2sls(y, X, Z, cluster = NULL)

Arguments

y

outcome.

X

regressors, endogenous and exogenous together.

Z

instruments; exogenous regressors instrument for themselves and belong in both.

cluster

optional cluster identifiers.

Value

list: beta, se, t, residuals, fitted, first_stage_F, overidentified, n_overid_restrictions, sargan, sargan_p, vcov_type, n, k, m, method.

Details

Residuals are y - X beta with the ORIGINAL X, not the first-stage fitted values. Using the fitted values there is a common and silent error that produces a smaller number which is not a standard error of anything.

References

Wooldridge (2010), Econometric Analysis of Cross Section and Panel Data, 2nd ed., Ch. 5; Sargan (1958), Econometrica 26:393-415.

Examples

set.seed(1)
Z <- matrix(stats::rnorm(200), 100)
D <- Z %*% c(1, 0.5) + stats::rnorm(100)
morie_caus_iv_2sls(2 * D + stats::rnorm(100), D, Z)$beta
#> [1] 0.05986324 1.93095777