ACADEMIC WRITING GUIDE
How to Conduct and Report Instrumental Variables Analysis in a Dissertation (With Worked Examples)
An invitation can change whether somebody attends a programme without determining attendance completely. That distinction gives instrumental variables analysis its opportunity—and its main difficulty. A researcher may be able to defend the assignment of an invitation while remaining unable to defend a direct comparison of people who chose to attend and people who did not.
Instrumental variables (IV) analysis uses a defensible external source of variation in a treatment or exposure to estimate a specified causal effect. It can address some forms of endogeneity, but it replaces the usual regression identification argument with demanding assumptions about an instrument. Finding a predictor of participation is only the beginning.
This guide explains those assumptions, two-stage least squares, weak-instrument diagnostics and dissertation reporting through an original public-library example. Every observation and result in the example is synthetic. The calculations were executed in Python and independently checked in JavaScript. R was unavailable; the reproducible R code has not been executed. Nothing here is evidence about a real library or programme.
Begin with the endogeneity problem
Suppose you want the effect of participation D on an outcome Y, allowing for baseline covariates X:
Outcome equation: Y_i = alpha + beta D_i + X_i' gamma + u_iOrdinary least squares (OLS) estimates the conditional association in this model. A causal interpretation needs an appropriate design and assumptions, including a treatment variation argument that rules out relevant dependence between D and the unobserved outcome determinants in u. Endogeneity means this requirement fails; adding more observations does not repair it.
Four common mechanisms deserve separate explanations:
Confounding: unrecorded persistence might increase both programme attendance and later performance. Adjustment for recorded characteristics leaves that pathway open.
Simultaneity: two variables are jointly determined—for example, service intensity and participant demand respond to each other during the same period.
Reverse causality: the outcome or its anticipated trajectory affects exposure. People expecting difficulty may seek more guidance; a later recorded exposure is then a poor explanation of an earlier outcome.
Measurement error: a mismeasured exposure can become correlated with the regression error. Classical measurement error attenuates the slope in a simple single-exposure regression, but that direction is not a general rule for every model or error process.
Explain which mechanism matters in your dissertation. “The data are observational” is insufficient by itself. A suitable instrument must address the particular endogeneity problem, not simply correlate with D. An alternative measurement, for instance, is not a valid instrument if its errors share the original measurement problem.
For the broader adjustment workflow, see our guide to analysing quantitative data. Here the central question is whether a separate source of treatment variation supports identification.
Define the instrument and defend three different conditions
Let Z denote a candidate instrument, D actual treatment, Y the outcome and X genuinely pretreatment covariates. In a linear constant-effect model, an IV argument combines relevance with appropriate exogeneity moments and an excluded causal pathway. These are related requirements, not interchangeable diagnostic labels.
| Requirement | Meaning in a dissertation | Useful evidence and its limit |
|---|---|---|
| Relevance | Z changes or predicts D after accounting for the included X; the required rank condition holds | Assignment mechanism, first-stage coefficient, uncertainty and strength diagnostics; statistical significance alone is insufficient |
| Exclusion restriction | Z affects Y only through the specified D, with the treatment definition and time window held fixed | Programme design, message content, institutional knowledge and credible alternative-pathway analysis; a first-stage F statistic cannot establish this |
| Instrument independence or exogeneity | Z is not associated with unobserved determinants of the outcome in the required sense | Genuine random assignment or a justified conditional assignment argument; balance and placebo checks can expose problems but cannot certify independence |
The linear moment restriction is often expressed as an instrument being uncorrelated with the structural error, after the stipulated covariate adjustment. For binary-treatment LATE identification, use the stronger potential-outcome statement: conditional on X, assignment is independent of potential treatment receipts and potential outcomes. State the version your interpretation actually requires.
Exclusion and independence differ. A perfectly randomized message can directly motivate practice and violate exclusion. Conversely, a message with no direct instructional content may be delivered preferentially to motivated people and fail independence. A large first stage resolves neither concern.
Randomization supports independence of assigned encouragement, not necessarily of opening the message, clicking the link or receiving it successfully. Analyse the assigned indicator when that is the randomized instrument, and document delivery failures separately. Verify that the encouragement does not change treatment quality, access to other services, outcome measurement or follow-up participation through additional pathways.
Hernán and Robins explain these design issues in Chapter 16 of Causal Inference: What If. An IV design also needs well-defined treatment versions and an appropriate no-interference assumption. If one person's invitation changes another person's access or behaviour, the simple individual-level model may be inappropriate.
Use a causal diagram to make the argument inspectable
A compact proposed diagram is:
Z --> D --> Y
^ ^
| |
U ----+
X --> D; X --> YU is an unrecorded common cause. The intended instrument is independent of U, possibly conditional on X. The absence of Z --> Y expresses exclusion; it is an assumption about the world, not a conclusion produced by drawing the graph. Investigate plausible omitted arrows, such as Z --> independent practice --> Y.
Choose X from the causal and assignment argument before viewing the desired result. Post-treatment engagement, attendance satisfaction or a response caused by the encouragement may be mediators or selection variables. Controlling for them can change the estimand or introduce bias. A diagram helps organize this reasoning, but does not prove the missing pathways are absent.
Decide whether IV fits the reader's actual research question
IV is useful when a meaningful treatment effect is the question, ordinary adjustment is doubtful, and a credible source of excluded treatment variation exists. Randomized encouragement, institutional allocation or a carefully justified natural experiment can sometimes provide that variation. Convenience, temporal precedence and correlation alone do not make an instrument credible.
IV is a poor choice when the proposed instrument has an obvious independent outcome pathway, barely changes treatment, has an unexplained allocation mechanism or identifies a subgroup irrelevant to the dissertation's question. If you cannot defend the instrument, retain a clearly qualified association or redesign the study rather than describing IV as a remedy for all observational confounding.
Keep neighbouring approaches distinct:
Regression adjustment compares outcomes conditional on measured covariates and needs an appropriate no-unmeasured-confounding argument for causality.
Propensity score matching builds measured-covariate comparisons. Matching does not supply an excluded instrument or remove unrecorded confounding automatically.
Difference-in-differences uses differential change under a parallel-trends argument and additional design assumptions.
Regression discontinuity uses an assignment cutoff and local continuity assumptions. A fuzzy design can use eligibility as an instrument, but its local design still needs its own justification.
Write the treatment, instrument, timing, estimand, covariate set, diagnostics and fallback interpretation into your data analysis plan. Avoid searching many possible instruments and presenting only the one that produces a preferred coefficient.
Understand the first stage, reduced form and second stage
With one excluded instrument and one endogenous treatment, the equations are:
First stage: D_i = a + pi Z_i + X_i' eta + v_i
Reduced form: Y_i = c + rho Z_i + X_i' lambda + e_i
Second stage: Y_i = alpha + beta Dhat_i + X_i' gamma + error_iThe first stage estimates how Z predicts participation after adjusting for X. Its fitted value Dhat is the component projected onto the instrument set. The reduced form estimates the relationship between assignment and the outcome. When Z is randomized, it can estimate an intention-to-encourage effect even if exclusion fails, provided outcome follow-up and the other randomized-comparison conditions remain defensible.
Two-stage least squares (2SLS) uses the projected treatment in the second-stage coefficient calculation. Include the same exogenous covariates and intercept in the structural model and instrument set; they act as instruments for themselves. Do not let software treat an endogenous covariate as exogenous merely because it is called a “control.”
With one excluded Z, one endogenous D and identical observations and controls in both auxiliary regressions, the IV treatment coefficient equals rho_hat / pi_hat. With no covariates and binary Z, this becomes the Wald ratio: the encouraged-minus-unencouraged outcome difference divided by the corresponding participation difference. Do not mix an adjusted reduced form with an unadjusted participation difference.
Under the linear constant-effect model and valid instruments, the population relationship is rho = beta*pi. Without exclusion, a direct effect of Z also enters the reduced form. With heterogeneous treatment effects, an appropriate ratio may instead identify a local average effect under the assumptions explained below.
Binary participation does not require a logistic first stage for linear 2SLS. A linear projection is appropriate for this estimator, even if some fitted values lie outside the probability range. Replacing it with fitted logistic probabilities or running a second-stage logistic model generally does not reproduce 2SLS. Binary outcomes and nonlinear structural questions need a separately justified estimand and estimator.
Manual staging is helpful for understanding the coefficient, but ordinary second-stage OLS standard errors are wrong for IV inference. IV software calculates uncertainty using the original structural residuals and appropriate instrument projections. The ivreg introduction documents the formula interface and the inclusion of exogenous regressors on both sides of the instrument separator.
Count identification conditions correctly
With one endogenous regressor, one relevant excluded instrument produces an exactly identified model. More valid excluded instruments can produce an overidentified model. With several endogenous regressors, having at least as many excluded instruments is a necessary order condition, but their conditional first-stage coefficient matrix must also have sufficient rank. Several instruments that predict only the same endogenous combination cannot identify every coefficient.
Count excluded instruments against endogenous regressors; do not count the intercept and included exogenous covariates as additional excluded identifying restrictions. Additional instruments may improve precision, but many weak instruments can worsen finite-sample behaviour. Their credibility matters more than their number.
Worked example: optional archive-navigation sessions
Research question and variables
A fictional public library offers an optional digital archive-navigation session. Does attending improve a later record-retrieval proficiency score among users whose attendance is changed by a randomized access-link message?
Eligible users can attend whether or not they receive the extra message. The message contains a neutral access link, without search instructions. This is deliberately different from assuming that encouragement equals participation.
| Role | Variable | Definition |
|---|---|---|
| Instrument | Z | Assignment to the additional access-link message: 1 assigned, 0 not assigned |
| Treatment | D | Actual attendance at the optional session: 1 attended, 0 did not |
| Outcome | Y | Record-retrieval proficiency assessed six weeks later on a score scale designed from 0 to 100 |
| Baseline covariates | X and B | Prior archive use, coded 0/1, and a baseline catalogue-search score; both recorded before assignment |
| Unobserved selection factor | U | Latent persistence, used only to construct the simulation; unavailable to the fitted analysis |
For this teaching design, assume concealed individual assignment, no spillovers, the same session content, blinded outcome assessment and complete follow-up. A real dissertation must provide evidence for those design features. The message could still prompt independent archive practice without attendance. Its neutral wording reduces one obvious concern but does not establish exclusion.
Transparent data generation and the target effect
The dataset contains 1600 synthetic users. A fixed portable random stream starts at seed 850027; the complete code specifies the draw order. Independently generate prior use X and latent persistence U as binary variables with probability 0.5, baseline B uniformly between 40 and 60, a uniform threshold V, randomized Z with probability 0.5, and a mean-zero, variance-one uniform noise E. The construction is:
p0 = 0.12 + 0.10 X + 0.12 U
delta = 0.32 + 0.08 U
D(0) = 1 if V < p0; otherwise 0
D(1) = 1 if V < p0 + delta; otherwise 0
D = D(Z)
Y = 30 + 10 X + 0.25 B + 6 U + (4 + 4 U) D + (3 + 2 X) EThe same V determines both potential attendance decisions. Encouragement cannot reduce attendance in this construction, so monotonicity holds by design. U raises both baseline attendance and the untreated outcome, creating selection that measured-covariate OLS does not remove. Noise varies with X, making heteroskedasticity-consistent uncertainty appropriate. There is no direct Z term in the generated outcome; this is an imposed teaching assumption, not an empirical finding.
Effects are heterogeneous: attendance adds 4 score points when U is zero and 8 when U is one. Users with U equal to one are more likely to be compliers because their attendance threshold moves further. The population complier effect is:
LATE = (0.5*0.32*4 + 0.5*0.40*8) / (0.5*0.32 + 0.5*0.40)
= 6.2222 score points
Population ATE = 0.5*4 + 0.5*8 = 6 score pointsThese are known properties of the generator. They are not estimates supplied to the fitted model. The realized IV estimate need not equal either quantity exactly. Constant assignment probability makes the covariate-adjusted IV ratio target the same population LATE here; more general assignment and adjustment schemes require careful examination of their weighting.
The sample includes 804 unencouraged users, of whom 190 attend, and 796 encouraged users, of whom 449 attend. Attendance rates are 23.63% and 56.41%, respectively. Both groups contain participants and nonparticipants; the first stage concerns their difference, not perfect compliance. The regressions below adjust for X and B and use every user.
Estimate the first stage, reduced form, OLS and IV
| Fitted comparison | Coefficient | HC1 standard error | 95% normal Wald interval |
|---|---|---|---|
| First stage: Z in D on Z, X, B | 0.3264 | 0.0230 | 0.2813 to 0.3714 |
| Reduced form: Z in Y on Z, X, B | 1.9692 | 0.3281 | 1.3262 to 2.6123 |
| OLS: D in Y on D, X, B | 6.8233 | 0.3097 | 6.2163 to 7.4304 |
| 2SLS: D instrumented by Z, adjusting for X, B | 6.0339 | 0.8812 | 4.3068 to 7.7610 |
The adjusted first stage is a 32.64 percentage-point increase in attendance. Its reduced form is a 1.9692-point effect of assigned encouragement on the later score under the randomized-comparison assumptions. Dividing the unrounded coefficients gives:
IV = 1.969238656876509 / 0.3263624268468548 = 6.0339Under independence, exclusion, relevance, monotonicity and the stated design conditions, this estimates the average effect of attendance for users whose attendance responds to this message. It does not estimate the effect of receiving the message, which is the reduced form, nor necessarily the effect for all library users.
The adjusted OLS association is 6.8233 points. Its narrower interval does not make its causal interpretation more credible. OLS and IV differ in both the variation used and, with heterogeneous effects, the potential target weighting. Their difference is not itself proof of endogeneity or instrument validity. In real data, do not choose whichever estimate looks more plausible or is statistically significant.
Check strength without turning a threshold into a verdict
The first-stage diagnostic tests the excluded instrument after including X and B, not whether the entire first-stage regression predicts attendance.
| Diagnostic | Calculated value | Interpretation and limit |
|---|---|---|
| Conventional excluded-Z F | 201.7111, with degrees of freedom 1 and 1596 | Residual-sum-of-squares comparison; its conventional reference distribution assumes homoskedastic errors |
| HC1 excluded-Z Wald statistic | 201.3771 | Squared HC1 coefficient-to-standard-error ratio for the single Z; a heteroskedasticity-consistent relevance diagnostic |
| Partial R-squared for excluded Z | 0.1122 | Additional explained treatment variation after removing X and B; not a test of exclusion or independence |
The conventional calculation uses restricted RSS 378.4379 and unrestricted RSS 335.9755: F = ((RSS0 - RSS1)/1) / (RSS1/1596). Partial R-squared is (RSS0 - RSS1)/RSS0. Calculations use unrounded inputs. The substantial first stage supports this example's relevance argument; it cannot rule out a direct message effect.
Staiger and Stock explain why weak first stages can distort IV estimates and conventional inference. The familiar “F above 10” rule is not a universal guarantee of reliable intervals. Stock and Yogo develop critical values tied to specified bias or test-size criteria and model dimensions; their standard framework is not automatically valid under arbitrary heteroskedasticity or clustering.
Montiel Olea and Pflueger develop strength testing suited to more general error structures. Do not attach their critical values, or homoskedastic Stock–Yogo tables, to an arbitrary software statistic without checking its definition. With multiple endogenous regressors, examine conditional strength and rank, rather than reporting only one attractive overall F. This example reports its calculated HC1 Wald diagnostic; it does not claim a separately implemented generalized effective-F test or Kleibergen–Paap analysis.
If instruments are weak, report the weak first stage and use an appropriate weak-IV-robust inference method, such as a correctly implemented Anderson–Rubin procedure. Do not fix weakness by adding questionable instruments, hiding imprecise results or collecting observations without considering the actual assignment and uptake mechanism.
Calculate uncertainty for the design you actually used
Every Wald interval in the estimate table uses an HC1 sandwich covariance, with finite-sample multiplier n/(n-k), four fitted structural coefficients including the intercept, and estimate ± 1.96*SE. For 2SLS the residual is from the original structural equation using actual D; the covariance uses projected regressors. These are asymptotic heteroskedasticity-consistent calculations for independent users. They are neither exact finite-sample intervals nor automatically robust to weak instruments.
Lee, McCrary, Moreira and Porter (2022) show why conventional IV t-ratio inference needs more care than a routine first-stage cutoff suggests. Strength screening and coefficient inference solve different problems. This example therefore also implements a heteroskedasticity-robust Anderson–Rubin inversion.
For each proposed effect beta0, regress Y - beta0*D on Z, X and B, then test the excluded Z coefficient with HC1 covariance. Accept values whose squared coefficient-to-SE ratio does not exceed the 95th percentile of a chi-squared distribution with one degree of freedom. The resulting 95% AR confidence set is 4.2727 to 7.7605 points. Both endpoints were obtained analytically and independently checked by evaluating the test at the boundary.
This AR calculation is asymptotically robust to weak identification and heteroskedasticity under the stipulated valid-IV moments and independent observations. It is not a randomization-exact test, does not accommodate clustering as implemented, and cannot protect against invalid instruments. Other datasets can produce an unbounded, disconnected or otherwise nonstandard confidence set; do not force every inversion into a finite interval. The R code deliberately stops unless this example's bounded-set conditions hold.
If encouragement is assigned by branch, class or district, or outcomes share shocks within those units, ordinary HC1 may understate uncertainty. Use a suitable cluster covariance at the design's dependence level, describe the number of independent clusters and justify any small-cluster correction. Repeated observations may require accounting for serial dependence. A random-intercept model is not a substitute for a valid IV covariance calculation; the multilevel modelling guide explains the separate nesting question. No cluster-robust numerical result is claimed here.
Interpret compliers and heterogeneous effects precisely
For a binary instrument and binary treatment, write D(1) and D(0) for a user's potential attendance under each assignment. Monotonicity requires D(1) >= D(0) for every user in the chosen direction: no user is discouraged from attending by the encouragement.
Compliers would attend when encouraged and not attend otherwise. Always-takers attend under either assignment; never-takers attend under neither. Defiers move in the opposite direction and are excluded by monotonicity. These are counterfactual response types, not labels for observed attendance groups. You generally cannot identify each person's type from one observed assignment and one participation decision.
The LATE result of Imbens and Angrist combines the instrument conditions with restrictions on treatment response. In the present construction, compliers are users near a participation threshold moved by this particular access message. They need not be representative of every user or every potential participant. A stronger invitation could move a different group and identify a different effect.
If a defensible linear structural model assumes the same additive effect beta for everyone, IV targets that common slope. LATE instead permits individual treatment effects to differ and identifies a specific average under additional conditions. Neither description should be applied automatically to all IV analyses. With continuous treatments, several instruments or covariate-dependent assignment, the estimand and weights require a separate derivation. The authors' Mostly Harmless Econometrics contents distinguish these extensions from elementary 2SLS.
Monotonicity is plausible in some designs and questionable in others. An extra message might irritate users or make a session appear remedial, reducing attendance for some. The simulation rules out that behaviour by construction; observed average take-up cannot rule it out in a real study.
Examine invalid instruments and sensitivity directly
Suppose the access message itself encourages independent practice that improves the score. Then the reduced form contains both the attendance pathway and that additional pathway. Even an enormous first-stage F would leave this interpretation problem unresolved.
For a transparent sensitivity exercise, posit a fixed additive direct effect gamma of assigned encouragement on Y. Keep the original dataset and assume the other identification conditions hold. Under this explicit model:
Y = attendance pathway + covariate terms + gamma Z + residual
beta(gamma) = (rho - gamma)/piThe table refits 2SLS with outcome Y - gamma*Z and recomputes HC1 uncertainty for each hypothetical gamma. The values are illustrative assumptions about a direct effect in score points, not estimates of that effect from these data.
| Assumed direct effect gamma | Adjusted IV estimate | Recomputed HC1 SE | Conditional 95% Wald interval |
|---|---|---|---|
| 0 | 6.0339 | 0.8812 | 4.3068 to 7.7610 |
| 0.25 | 5.2679 | 0.8867 | 3.5300 to 7.0058 |
| 0.50 | 4.5019 | 0.8954 | 2.7469 to 6.2568 |
| 1.00 | 2.9698 | 0.9221 | 1.1625 to 4.7771 |
For an assumed half-point direct effect, the attendance estimate falls to 4.5019 points. The same direct effect causes a larger distortion when the first stage is smaller, because it is divided by pi. A real analysis should justify a plausible direct-effect range using subject knowledge or external evidence and consider both signs when appropriate.
These intervals condition on each fixed gamma. They do not account for uncertainty over gamma, establish its plausible range, or implement the full methods of Conley, Hansen and Rossi (2012), Plausibly Exogenous. That paper develops inference while relaxing exclusion; see the author's publication record. Merely comparing the rows and declaring the original estimate “robust” would overstate this exercise.
Other useful checks include prespecified baseline and negative-control outcomes, alternative credible specifications, documented encouragement content, treatment-version checks, outcome-blinding evidence and attrition by assignment. Their purpose is to probe particular alternative pathways. They cannot jointly prove validity. Sensitivity to instrument independence or nonmonotonic response is a further problem, not covered by changing gamma alone.
Overidentification tests cannot certify an instrument
In an overidentified model, a Sargan test under its classical assumptions, or a suitable heteroskedasticity-robust Hansen J procedure, can examine whether the extra moment restrictions are jointly compatible with the fitted model. Failure to reject does not prove that every instrument is valid; tests may lack power, and invalid instruments can agree with one another.
Rejection is a warning about the restrictions and model, not a reliable label naming the invalid instrument. Under heterogeneous effects, instruments that move different populations may also conflict with an imposed common-coefficient model. An endogeneity test such as Durbin–Wu–Hausman likewise depends on maintained instrument and model assumptions; it does not validate the instrument first.
The archive example has one excluded instrument and one endogenous regressor, so it has no overidentifying restriction to test. No Sargan or Hansen test output is reported. The ivreg diagnostics documentation illustrates exactly identified and overidentified equations and the limits of applying their diagnostics.
Reproduce the dataset and fitted analysis in R
The following complete script regenerates the observed dataset rather than requiring an unavailable download. It fits the models with ivreg and uses sandwich::vcovHC(type = "HC1"); the official inference documentation explains covariance replacement. Package default summaries may use different degrees of freedom or covariance choices, so the script constructs the stated intervals explicitly.
Execution disclosure: this R script was not run. Python 3.12.10 with NumPy 2.5.3 executed the matrix calculations. Independent JavaScript regenerated every record and used residualized moment calculations to verify the estimates, HC1 standard errors, intervals, diagnostics, sensitivity rows and AR endpoints. The displayed figures are calculated outputs from those implementations, not invented R output. Retain your own software versions and sessionInfo() when reproducing the analysis.
# SYNTHETIC TEACHING DATA. R CODE NOT EXECUTED IN ARTICLE PREPARATION.
# Install ivreg and sandwich separately if needed; retain sessionInfo().
library(ivreg)
library(sandwich)
# Explicit portable random stream: same draw order as Python and JavaScript.
state <- 850027
unif <- function() {
state <<- (16807 * state) %% 2147483647
state / 2147483647
}
n <- 1600
dat <- data.frame(id = seq_len(n), x = 0, b = 0, z = 0, d = 0, y = 0)
for (i in seq_len(n)) {
x <- as.integer(unif() < 0.5)
b <- 40 + 20 * unif()
u <- as.integer(unif() < 0.5) # latent persistence: omit from estimation
v <- unif()
z <- as.integer(unif() < 0.5)
e <- sqrt(12) * (unif() - 0.5)
p0 <- 0.12 + 0.10 * x + 0.12 * u
delta <- 0.32 + 0.08 * u
d0 <- as.integer(v < p0)
d1 <- as.integer(v < p0 + delta)
d <- if (z == 1) d1 else d0
y <- 30 + 10*x + 0.25*b + 6*u + (4 + 4*u)*d + (3 + 2*x)*e
dat[i, ] <- c(i, x, b, z, d, y)
}
stopifnot(nrow(dat) == 1600, !anyNA(dat))
write.csv(dat, "synthetic-archive-observed.csv", row.names = FALSE)
fs <- lm(d ~ z + x + b, data = dat)
rf <- lm(y ~ z + x + b, data = dat)
ols <- lm(y ~ d + x + b, data = dat)
iv <- ivreg(y ~ d + x + b | z + x + b, data = dat)
hc1 <- function(model) vcovHC(model, type = "HC1")
row <- function(model, term) {
est <- unname(coef(model)[term])
se <- sqrt(hc1(model)[term, term])
c(estimate = est, HC1_SE = se, lower = est - 1.96*se,
upper = est + 1.96*se)
}
print(rbind(first_stage = row(fs, "z"), reduced_form = row(rf, "z"),
OLS = row(ols, "d"), IV = row(iv, "d")), digits = 8)
stopifnot(abs(coef(iv)["d"] - coef(rf)["z"]/coef(fs)["z"]) < 1e-8)
# Excluded-Z F, not the first stage's overall model F.
fs0 <- lm(d ~ x + b, data = dat)
rss0 <- sum(resid(fs0)^2)
rss1 <- sum(resid(fs)^2)
print(c(F_excluded = (rss0-rss1)/(rss1/df.residual(fs)),
partial_R2 = (rss0-rss1)/rss0,
HC1_Wald_Z = coef(fs)["z"]^2/hc1(fs)["z", "z"]))
# Heteroskedasticity-robust AR inversion for this one-instrument model.
# Test coefficient z in lm(y - beta0*d ~ z + x + b) with HC1.
# Its variance is a quadratic in beta0; solve the acceptance inequality.
W <- model.matrix(fs)
qz <- as.vector(W %*% solve(crossprod(W))[, "z"])
scale <- n/df.residual(fs)
va <- scale * sum(qz^2 * resid(rf)^2)
vb <- scale * sum(qz^2 * resid(fs)^2)
vab <- scale * sum(qz^2 * resid(rf) * resid(fs))
pi <- unname(coef(fs)["z"])
rho <- unname(coef(rf)["z"])
c95 <- qchisq(0.95, df = 1)
A <- pi^2 - c95*vb
B <- -2*pi*rho + 2*c95*vab
Q <- rho^2 - c95*va
disc <- B^2 - 4*A*Q
# This dataset has a bounded interval. Other datasets need full set logic.
stopifnot(A > 0, disc > 0)
AR95 <- sort(c((-B-sqrt(disc))/(2*A), (-B+sqrt(disc))/(2*A)))
print(AR95, digits = 8)
# Direct-effect sensitivity: gamma is fixed, hypothetical and prespecified.
# Each interval conditions on that gamma; these are not uncertainty bounds
# over an unknown gamma and are not Conley et al.'s full procedure.
sens <- lapply(c(0, 0.25, 0.5, 1), function(gamma) {
dd <- transform(dat, y_adj = y - gamma*z)
fit <- ivreg(y_adj ~ d + x + b | z + x + b, data = dd)
c(gamma = gamma, row(fit, "d"))
})
print(do.call(rbind, sens), digits = 8)
sessionInfo()Write the dissertation methods and results around identification
Report the instrument's institutional or experimental origin, assignment unit and probability, actual participation measurement, outcome timing, baseline covariates, exclusions and missingness. State why alternative instrument-to-outcome pathways are absent or limited, what effect is identified and which assumptions remain unverifiable. Then name the estimator and covariance convention, first-stage diagnostics, coefficient inference and sensitivity procedures.
The following paragraphs describe only this synthetic exercise. Adapt their reasoning to your design; do not copy their factual design claims into a real dissertation.
Illustrative methods paragraph
We generated 1600 synthetic library users to illustrate an individually randomized encouragement design. Assignment to a neutral access-link message was the excluded instrument for attendance at an optional archive-navigation session. The outcome was a record-retrieval proficiency score six weeks later. Two-stage least squares included pretreatment archive use and baseline catalogue-search score as exogenous covariates in both the structural model and instrument set. The estimand was the attendance effect among users whose participation would change under the message, assuming instrument independence, relevance, exclusion, monotonicity, consistent treatment and no interference. The generator imposed these conditions; they would require substantive justification in a real study. We reported the first stage and reduced form, excluded-instrument strength diagnostics, HC1 covariance with n/(n-k) scaling and normal Wald intervals, an HC1 Anderson–Rubin confidence set, and conditional sensitivity to fixed additive direct message effects.
Illustrative results paragraph
Across the same 1600 users, assigned encouragement increased adjusted attendance probability by 0.3264 (HC1 SE 0.0230; 95% Wald CI 0.2813 to 0.3714). The adjusted reduced-form outcome effect was 1.9692 points (SE 0.3281; CI 1.3262 to 2.6123). The excluded-instrument conventional F was 201.7111 with 1 and 1596 degrees of freedom; the HC1 Wald statistic was 201.3771 and partial R-squared was 0.1122. The 2SLS attendance estimate was 6.0339 points (HC1 SE 0.8812; normal Wald CI 4.3068 to 7.7610), compared with an adjusted OLS association of 6.8233. The heteroskedasticity-robust AR confidence set was 4.2727 to 7.7605. Under the stated assumptions, IV estimates an effect for encouragement-responsive users, not all users. Assuming a direct half-point message effect changed the estimate to 4.5019 points. The synthetic design, assumed exclusion and local target preclude claims about real programme effectiveness or a universal attendance effect.
Place the design argument beside the coefficient. A table of small p-values cannot replace an explanation of why the instrument can affect participation without independently changing the outcome.
Frequently asked questions
Does randomizing encouragement automatically produce a valid instrument?
No. Randomization can support independence of assigned encouragement. You must still establish a meaningful first stage and defend exclusion, treatment consistency, interference assumptions and the conditions for the intended estimand. The message itself may change the outcome through motivation or other services.
Is a large first-stage F enough to justify IV?
No. It addresses a strength question under a particular statistic and error model. It cannot establish exclusion or independence, and a conventional cutoff does not automatically validate coefficient inference. Name the statistic, its covariance convention and the diagnostic criterion actually used.
Why are attendance and encouragement different variables?
Attendance is the treatment whose effect is sought. Assigned encouragement is the proposed instrument. Some encouraged users do not attend and some unencouraged users attend anyway. Treating those indicators as interchangeable changes the causal question and eliminates the compliance problem rather than analysing it.
Should a binary treatment use a logistic first stage?
Not for ordinary linear 2SLS merely because D is binary. Use the estimator's linear projection and correct IV uncertainty. A nonlinear structural model requires its own identification and estimation argument; replacing stages mechanically with logistic regressions is not a general solution.
Can I claim an effect for every participant from a LATE estimate?
No. Compliers are defined by their potential response to this instrument. They differ conceptually from everyone who attended, everyone invited and everyone eligible. Generalization beyond that local group needs additional assumptions and evidence.
Can I test exclusion with my dataset?
You can investigate implications and competing pathways, but the routine first stage cannot prove exclusion. Overidentification tests need extra instruments and maintained model assumptions; even then, nonrejection is not proof. In an exactly identified model there is no overidentification test available.
What if the IV and OLS estimates are very different?
Check coding, samples, controls, first-stage strength, uncertainty and instrument credibility. Endogeneity can explain differences, but heterogeneous targets, weak instruments and exclusion failures can also matter. Agreement is not proof of validity either.
Does the AR confidence set fix an invalid instrument?
No. Weak-IV robustness concerns identification strength under valid instrument restrictions. It does not repair a direct encouragement effect, confounded assignment, attrition bias or interference. The implemented AR calculation also assumes independent observations; clustered designs require an appropriate extension.
Support for understanding and reporting your own IV analysis
Acadelyra can help you clarify the instrument argument, understand software output and improve the transparency of your own methods and results. Explore our academic support services for guidance and editorial feedback. You remain responsible for the research design, original analysis, ethical approvals and work submitted under your institution's academic-integrity rules.
References and further reading
Angrist, J. D., and Pischke, J.-S. (2009). Mostly Harmless Econometrics: An Empiricist's Companion. Princeton University Press. DOI: 10.1515/9781400829828. The authors' contents locate 2SLS, heterogeneous effects and nonstandard standard errors; this page is a reading map, not a substitute for the full chapters.
Hernán, M. A., and Robins, J. M. (2020). Causal Inference: What If. Boca Raton: Chapman & Hall/CRC. Author-hosted book and current version, Chapters 6 and 16. The online text is updated; the August 2026 version was consulted.
Imbens, G. W., and Angrist, J. D. (1994). Identification and Estimation of Local Average Treatment Effects. Econometrica, 62(2), 467–475. DOI: 10.2307/2951620. The NBER version is Technical Working Paper 118, issued February 1995, with the authors ordered Angrist and Imbens; its working-paper DOI is 10.3386/t0118. It is not the journal publication date or DOI.
Staiger, D., and Stock, J. H. (1997). Instrumental Variables Regression with Weak Instruments. Econometrica, 65(3), 557–586. DOI: 10.2307/2171753. The NBER record links the earlier 1994 working paper; the published paper was also consulted through the author's hosted copy.
Stock, J. H., and Yogo, M. (2005). Testing for Weak Instruments in Linear IV Regression. In D. W. K. Andrews and J. H. Stock (Eds.), Identification and Inference for Econometric Models: Essays in Honor of Thomas Rothenberg (pp. 80–108). Cambridge University Press. DOI: 10.1017/CBO9780511614491.006. The NBER version is Technical Working Paper 284 (2002); distinguish this from the published chapter.
Montiel Olea, J. L., and Pflueger, C. (2013). A Robust Test for Weak Instruments. Journal of Business & Economic Statistics, 31(3), 358–369. DOI: 10.1080/00401706.2013.806694. Author-hosted published article.
Lee, D. S., McCrary, J., Moreira, M. J., and Porter, J. (2022). Valid t-Ratio Inference for IV. American Economic Review, 112(10), 3260–3290. DOI: 10.1257/aer.20211063. Publisher record and abstract.
Conley, T. G., Hansen, C. B., and Rossi, P. E. (2012). Plausibly Exogenous. Review of Economics and Statistics, 94(1), 260–272. DOI: 10.1162/REST_a_00139. Author's publication record; the July 2008 working-paper version was also consulted for the direct-effect formulation and conditional-inference distinction.
Fox, J., Kleiber, C., and Zeileis, A. ivreg introduction (vignette modified 20 April 2024), 2SLS diagnostics (modified 16 May 2023), and summary and inference reference. Official software documentation consulted for formula specification, diagnostics and HC1 covariance replacement.