Instrumental variables calculator
Calculate a just-identified IV estimate with one endogenous regressor and one instrument. Your inputs stay on your device.
Set up your task
Starting local processing
Ready. Processing stays in this browser.
2 Your result
Your result updates in this browser. Check your input if the result looks unexpected.
How to use Instrumental variables calculator
Calculate a just-identified IV estimate with one endogenous regressor and one instrument. The example below shows the input values and the result so you can compare the calculator’s method with your own working.
- Start with the pre-filled values for data rows (outcome y, regressor x, instrument z).
- Replace the example with your own coursework values. Keep units consistent across the inputs and compare with the stated model.
- Read the intermediate values in the result. Use the check below to see how a change in the assumptions affects the answer.
Supported inputs and limits
Use 3 to 150 complete rows of Y, X and Z. The instrument and regressor must vary. The fitted model has an intercept and uses no extra controls.
How it works
Instrumental variables replaces the variation in an endogenous regressor with variation associated with an instrument. In the one-regressor, one-instrument model with an intercept, the estimated slope is the covariance of Z with Y divided by the covariance of Z with X. It equals the reduced-form slope divided by the first-stage slope.
The first stage measures how strongly X moves with Z. The reduced form measures how Y moves with Z. Their ratio is the just-identified two-stage least squares coefficient. The calculator displays the classical first-stage F statistic for one instrument as a diagnostic. Using an instrument for a causal claim requires an economic argument about its relevance, independence and exclusion restriction.
Example
The pre-filled example gives “IV slope: 2.14285714” as its first result.
- Data rows (outcome Y, regressor X, instrument Z)
- 1 1 0
4 2 0
8 4 1
12 6 1
IV slope: 2.14285714 Intercept: -0.714285714 First stage, Z → X: 3.5 · Reduced form, Z → Y: 7.5 First-stage R²: 0.830508475 Classical first-stage F (one instrument): 9.8 The just-identified slope is the reduced-form slope divided by the first-stage slope.
Questions about Instrumental variables calculator
Can I enter a binary instrument and calculate a Wald estimate?
Yes. With 0/1 instrument values, the two slopes equal the differences in group means of X and Y. Their ratio is the Wald estimate.
Does a high first-stage F validate the instrument?
It describes a first-stage relationship under the reported classical assumptions. It cannot establish independence or exclusion.
What are the mean differences in the example?
The outcome means are 2.5 and 10. The regressor means are 1.5 and 5. Divide 7.5 by 3.5 to get approximately 2.143.
Related tools
Last updated