Calculator inputs
Enter matching observations for the dependent variable, endogenous regressor, and instrument. Use commas, spaces, or new lines.
Example data table
This sample illustrates a just-identified setup with one instrument and one endogenous regressor.
| Observation | Outcome (Y) | Endogenous Variable (X) | Instrument (Z) |
|---|---|---|---|
| 1 | 12 | 3 | 2 |
| 2 | 14 | 4 | 3 |
| 3 | 15 | 4 | 3 |
| 4 | 19 | 6 | 5 |
| 5 | 20 | 7 | 5 |
| 6 | 23 | 8 | 6 |
| 7 | 25 | 8 | 7 |
| 8 | 27 | 10 | 8 |
Formula used
This calculator uses a just-identified instrumental variable estimator with an intercept. It is suitable when one instrument explains one endogenous regressor.
Instrumental variable slope
β̂IV = Cov(Z, Y) / Cov(Z, X)
Intercept
α̂IV = Ȳ - β̂IVX̄
First-stage regression
X̂ = π̂0 + π̂1Z
π̂1 = Cov(Z, X) / Var(Z)
Reduced form
ŶRF = δ̂0 + δ̂1Z
δ̂1 = Cov(Z, Y) / Var(Z)
First-stage strength diagnostic
R² = Corr(Z, X)²
F = (R² / (1 - R²)) × (n - 2)
Approximate IV standard error
SE(β̂IV) = √[ σ̂² × Σ(zᵢ - z̄)² / (Σ(zᵢ - z̄)(xᵢ - x̄))² ]
The IV estimate is also the ratio of the reduced-form slope to the first-stage slope in this one-instrument setting.
How to use this calculator
- Enter the outcome values in the Y field.
- Enter the endogenous regressor values in the X field.
- Enter the instrument values in the Z field.
- Keep all three series aligned by observation order.
- Select the confidence level and preferred decimal places.
- Click the calculate button to generate IV and OLS outputs.
- Review the first-stage F statistic before trusting the estimate.
- Use the CSV or PDF buttons to export results.
Frequently asked questions
1. What does this calculator estimate?
It estimates a causal slope using an instrument to isolate variation in the endogenous regressor. It also reports OLS, first-stage fit, reduced form, fitted values, and an approximate confidence interval.
2. When should I use an instrumental variable estimator?
Use it when X is correlated with omitted factors, simultaneity, or measurement error, and you have a credible instrument that affects X but influences Y only through X.
3. Why is the first-stage F statistic important?
It helps assess instrument relevance. A low value suggests the instrument may be weak, which can make IV estimates unstable, biased, and highly sensitive to noise.
4. What if the instrument does not vary?
The estimator cannot be computed. Variation in the instrument is required because the method depends on how changes in Z shift X and, through X, Y.
5. Why can IV and OLS results differ a lot?
Large differences often indicate endogeneity in OLS, but they can also reflect weak instruments or noisy data. The first-stage diagnostics should be checked before drawing conclusions.
6. Does this file support multiple instruments?
This version is designed for one endogenous regressor and one instrument with an intercept. For multiple instruments or controls, a full matrix-based 2SLS implementation is needed.
7. Are the confidence intervals exact?
They are approximate and based on a simple homoskedastic standard error formula. For publication-grade inference, robust or clustered standard errors are often more appropriate.
8. Can I use spaces or new lines instead of commas?
Yes. The parser accepts commas, spaces, semicolons, tabs, and line breaks. The only requirement is that Y, X, and Z contain the same number of observations.