Lesson 13
Testing One Linear Combination of Parameters
Big question
How do we test beta one equals beta two?
Lesson progress
Complete checkpoints as you learn
Learning objectives
- Explain testing one linear combination of parameters in plain language.
- Use standard error correctly in an interpretation.
- Connect the lesson idea to a formula, graph, Python result, or real example.
Simple explanation
A linear combination such as beta1 minus beta2 equals zero has its own estimate and standard error.
Key terms
- standard error
- The estimated sampling standard deviation of an estimator.
- restricted model
- The model estimated after imposing the null restrictions.
- numerator degrees of freedom
- The number of restrictions being tested in an F test.
Core formula
Use plain-language interpretation before algebra.
Example
WAGE2 gives students a real-data setting for testing one linear combination of parameters. The lesson emphasizes inference mechanics and interpretation, not memorized output.
Interactive visual
LinearCombinationTester
Original Module 4 visual for Testing One Linear Combination of Parameters.
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
Testing One Linear Combination of Parameters Python example
Testing One Linear Combination of Parameters 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 4Load the dataset into a pandas DataFrame.
- Line 5Add an intercept column to the regression design matrix.
- Line 6Create or update a Python object used in the analysis.
- Line 7Display a result so students can inspect the output.
- Line 8Display a result so students can inspect the output.
Python walkthrough
- 1Load the real dataset and keep the variables needed for the model.
- 2Estimate OLS with statsmodels.
- 3Compute the statistic, p-value, or confidence interval.
- 4Interpret the result with units, controls, and limitations.
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
WAGE2
Estimated time
25 to 40 min
Packages
pandas, numpy, statsmodels, patsy
Expected output
Printed Python results that can be compared with the lesson explanation.
Learning goals
- Load and inspect WAGE2.
- Run the Python cells connected to Testing One Linear Combination of Parameters.
- Interpret the output using linear combinations and coefficient equality.
Common errors
- File not found: check that WAGE2.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/WAGE2.DTA")
df.head()Interactive activity
LinearCombinationTester
Test a coefficient difference
Build beta_exper minus beta_tenure and interpret the result.
Inputs
Try it yourself
Write one plain-English sentence explaining the main idea from this lesson.
Common mistakes
Check these before you move on.
A regression coefficient describes a pattern unless the assumptions or research design support a causal interpretation.
Quick quiz
What is the safest inference focus in Testing One Linear Combination of Parameters?
Quick quiz
Which reporting habit is most important in Testing One Linear Combination of Parameters?
Quick quiz
Why is MLB1 a reasonable practice dataset here?
Key takeaway
Testing One Linear Combination of Parameters turns regression output into evidence only when the hypothesis, assumptions, and magnitude are stated clearly.