Instrumental variables
Follow an instrument from the first stage to the IV estimate. Then weaken it, or break exclusion, and examine what the same analysis can tell you.
Show a hint
The same observations, three views
OLS and IV on this sample
Why a manual second-stage regression gives the wrong standard error
The second-stage coefficient uses the part of x predicted by z.
Its uncertainty still depends on the structural residual
y − intercept − b × x. A regression on fitted x uses
a different residual. Use ivregress 2sls to compute
the IV covariance.
Anderson–Rubin inference
Coefficient values and confidence sets
For each candidate b, regress y − b × x on z. If the
instrument is valid and b is the true coefficient, z should not
predict this transformed outcome. The confidence set collects the
candidates this test does not reject.
Finite endpoints are rounded. Candidate tests below use the unrounded calculations.
The plot is centered at zero; arrows mark accepted values beyond its edges. The confidence set above uses analytic endpoints, independent of this window.
Why can a confidence set have two pieces or include every value?
A weak first stage leaves the denominator of the IV ratio poorly determined. The data may fail to reject very large positive and negative coefficients while rejecting values between them. If every candidate passes the test, the confidence set is the whole real line. That is an absence of useful precision from this test; it is not evidence that the effect is zero.
From this browser experiment to Stata
The export contains this exact synthetic sample, the settings and a do-file. Run the do-file in its folder to reproduce the first stage, reduced form, OLS, 2SLS and the candidate Anderson–Rubin test. The browser performs these calculations locally; the Practice command box supports a smaller command set.
What the experiment assumes
z, v and e are independent standard-normal draws. The structural
error is u = σ[ρv + √(1 − ρ²)e]. Thus ρ controls
correlation between the first-stage error and the structural error.
z remains independent of u throughout this experiment. The δ control
introduces a direct effect of z on y, violating exclusion.
When π is nonzero, the population IV ratio is β + δ/π.
When π is zero, this ratio is undefined; a nonzero sample first
stage does not create population identification. There is one
instrument for one endogenous regressor, so there is no
overidentification test. The fitted IV residual is mechanically
orthogonal to z even when exclusion fails.
Both covariance options use the small correction and
t/F reference distributions with n − 2 residual degrees of freedom.
The conventional Anderson–Rubin test has an exact finite-sample
reference under the valid normal, homoskedastic population used
here. The HC1 version with this F reference is an approximation.
Neither protects against an invalid instrument.
References: Stata’s ivregress manual and postestimation and weak-instrument inference.
Your task, settings, response and notes are stored in this browser. Saved work can back up or restore them. Project exports include a separate investigation record.