Lesson 16
F Tests for Exclusion Restrictions
Big question
How do we test whether a group of variables can be omitted?
Lesson progress
Complete checkpoints as you learn
Learning objectives
- Explain f tests for exclusion restrictions in plain language.
- Use linear combination correctly in an interpretation.
- Connect the lesson idea to a formula, graph, Python result, or real example.
Simple explanation
For exclusion restrictions, compare the restricted and unrestricted residual sums of squares and account for q restrictions.
Key terms
- linear combination
- A weighted sum of regression parameters, such as beta1 minus beta2.
- exclusion restriction
- A restriction that a group of slopes equals zero.
- joint significance
- Evidence that a group of variables matters collectively.
Core formula
Use plain-language interpretation before algebra.
Example
MLB1 gives students a real-data setting for f tests for exclusion restrictions. The lesson emphasizes inference mechanics and interpretation, not memorized output.
Interactive visual
FStatisticCalculator
Original Module 4 visual for F Tests for Exclusion Restrictions.
y variable
wage
The dependent variable. It is the outcome students want to explain.
x variable
education
The explanatory variable. It is used to describe changes in wage.
Live Python
F Tests for Exclusion Restrictions Python example
F Tests for Exclusion Restrictions Python example
Stdout
Run Python to see results here.
Status / stderr
Ready to run Python in your browser.
Line-by-line guide
- Line 1Load a Python library needed for data work or regression.
- Line 2Load a Python library needed for data work or regression.
- Line 3Load a Python library needed for data work or regression.
- Line 5Load the dataset into a pandas DataFrame.
- Line 6Create or update a Python object used in the analysis.
- Line 7Add an intercept column to the regression design matrix.
- Line 8Add an intercept column to the regression design matrix.
- Line 9Create or update a Python object used in the analysis.
- Line 10Create or update a Python object used in the analysis.
- Line 11Create or update a Python object used in the analysis.
- Line 12Display a result so students can inspect the output.
- Line 13Display a result so students can inspect the output.
Python walkthrough
- 1Load the real dataset and keep the variables needed for both models.
- 2Estimate unrestricted and restricted models or use statsmodels f_test.
- 3Compute or read the F statistic and p-value.
- 4Interpret the test as a joint statement about population parameters.
Live notebook
Run this lesson as a notebook
Open an editable notebook cell-by-cell, run Python in the browser, and download the `.ipynb` file for later.
Related dataset
BWGHT
Estimated time
25 to 40 min
Packages
pandas, numpy, statsmodels, patsy
Expected output
A regression or inference table with coefficients, uncertainty, and short interpretation notes.
Learning goals
- Load and inspect BWGHT.
- Run the Python cells connected to F Tests for Exclusion Restrictions.
- Interpret the output using F tests and restricted model.
Common errors
- File not found: check that BWGHT.DTA is installed or use the course data folder.
- Package import error: use the browser notebook first, then download for local Jupyter if your local packages differ.
- Column name error: compare your variable names with the dataset variables listed for this notebook.
Dataset path helper
import pandas as pd
df = pd.read_stata("/data/BWGHT.DTA")
df.head()Interactive activity
FStatisticCalculator
Compute an F statistic
Use SSR values, q restrictions, and residual degrees of freedom.
Inputs
Try it yourself
Write one plain-English sentence explaining the main idea from this lesson.
Common mistakes
Check these before you move on.
Return to the lesson assumptions, units, diagnostics, and source evidence to replace this shortcut with a defensible interpretation.
Quick quiz
What is the safest inference focus in F Tests for Exclusion Restrictions?
Quick quiz
Which reporting habit is most important in F Tests for Exclusion Restrictions?
Quick quiz
Why is ATTEND a reasonable practice dataset here?
Key takeaway
F Tests for Exclusion Restrictions turns regression output into evidence only when the hypothesis, assumptions, and magnitude are stated clearly.