Hello! Welcome to the sixth module of our intensive exam preparation course.
In the last lesson, we focused on the Likelihood Ratio Test (LRT) for comparing nested models. We saw that the LRT is a powerful tool for determining if a more complex model provides a significantly better fit than a simpler one, but it has one key requirement: you must fit and compare two separate models.
Today, we'll learn a more direct and computationally efficient method for testing the significance of predictors: the Wald test. This test is a cornerstone of hypothesis testing in GLMs and will almost certainly appear on your exam. It allows you to assess the significance of an individual predictor using the output from just a single model fit.
Your learning outcome for this lesson is to be able to perform and interpret a Wald test to assess the significance of an individual GLM parameter.
1. The Intuition Behind the Wald Test
At its core, the Wald test answers a simple question: "Is the estimated coefficient for my predictor far enough from zero to be considered statistically significant?"
To answer this, the test considers two crucial pieces of information that you get from your model output:
- The Coefficient Estimate (): This is the model's best guess for the predictor's effect. The further this value is from zero, the more evidence we have for an effect.
- The Standard Error of the Estimate (): This measures the uncertainty or variability in our estimate. A small standard error implies our estimate is precise; a large standard error means our estimate is noisy and less reliable.
The Wald test combines these two pieces of information into a single test statistic. The intuition is that we are more confident in an effect if the estimate is large relative to its uncertainty.
To build a solid intuition for this, let's watch a short video.
This video from Ben Lambert explains the logic of the Wald test by visualizing the likelihood function. Focus on how the shape of the likelihood curve (peaked vs. flat) relates to the certainty of our estimate (the denominator of the test statistic).
Watch from 01:15 to 05:17. The video discusses the univariate case, which is exactly what we need. Pay attention to the comparison between the 'yellow' (more certain) and 'red' (less certain) likelihood curves. This visually explains why we divide by the variance (or standard error) in the test.
2. The Wald Test Statistic
As the video explained, the Wald test formalizes the idea of comparing an estimate to its uncertainty. For testing a single coefficient , the null hypothesis is typically that the coefficient is zero (), meaning the predictor has no effect.
The Wald test statistic, often called a z-statistic, is calculated as:
Where:
- is the estimated coefficient from the model output.
- is the value of the coefficient under the null hypothesis (usually 0).
- is the standard error of the estimated coefficient, also from the model output.
When testing , the formula simplifies to:
For large sample sizes, this -statistic follows a standard normal distribution, . We can use this property to calculate a p-value and make a decision.
3. Performing and Interpreting the Wald Test: A Practical Guide
This is the most important part for your exam. You will be given model output and expected to draw a conclusion about a predictor's significance. Here is the step-by-step process.
Step 1: State the Hypotheses
- Null Hypothesis (): . The predictor has no statistically significant effect on the response variable, holding all other predictors constant.
- Alternative Hypothesis (): . The predictor has a statistically significant effect.
Step 2: Extract Information from Model Output
Let's watch a video that shows exactly where to find the necessary values in a typical model summary.
Logistic Regression Details Pt1: Coefficients
This StatQuest video on logistic regression provides an excellent, clear walkthrough of interpreting the coefficients table, which is where the Wald test results are presented. Even though it's about logistic regression, the interpretation is identical for any GLM.
Watch the segment from 08:37 to 10:34. Josh Starmer explains each column of the coefficient table: the estimate, standard error, z-value, and p-value. He uses a fantastic rule of thumb for interpreting the z-value that will be very useful on your exam.
As the video showed, a typical GLM output will look something like this:
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -3.492044 0.236118 -14.789 < 2e-16 ***
floor 0.660032 0.073428 8.989 < 2e-16 ***
Here, for the floor predictor:
Estimate() = 0.660032Std. Error() = 0.073428z value= 8.989Pr(>|z|)(p-value) is very small (< 2e-16).
Step 3: Verify the Test Statistic (and the "Rule of Thumb")
The software calculates the z value for you:
As Josh Starmer mentioned, a common rule of thumb for a 5% significance level () is to check if the absolute value of the z-statistic is greater than 2 (the more precise value is 1.96). In this case, , so we have strong evidence against the null hypothesis.
Step 4: Make a Decision
You have two ways to make a decision, and both will lead to the same conclusion:
-
The p-value Method (Easiest & Most Common): Compare the p-value (
Pr(>|z|)) to your significance level .- If p-value < , reject .
- If p-value , fail to reject .
In our example, p < 0.001, which is much smaller than 0.05. We reject .
-
The Critical Value Method (The "Rule of Thumb"): Compare the absolute value of the z-statistic to the critical value from the standard normal distribution (e.g., 1.96 for ).
- If , reject .
- If , fail to reject .
In our example, , so we reject .
Step 5: Interpret the Conclusion
Since we rejected , we conclude that the floor predictor is statistically significant. There is strong evidence that it has a non-zero effect on the outcome.
Let's solidify this with a document that shows the same process using R output.
[PDF] Chapter 3 Generalized Linear Models (GLM)
This PDF document provides a concise summary of the Wald test and clearly labels the components within an R summary output. It also shows an example of testing a null hypothesis where the value is not zero.
Read the sections '3.4 Statistical Inference for GLMs' through the example calculation. The text starts with 'The Wald statistic for testing H0: β = c...'. Notice how the z value in the R output is calculated from the Estimate and Std. Error. Also, pay attention to the example of testing H0: β = 0.05, which shows how the general formula is applied when the null value isn't 0.
4. Wald Tests and Confidence Intervals
There is a direct link between the Wald test and confidence intervals. A (1-)100% Wald confidence interval for a coefficient is calculated as:
Where is the critical value from the standard normal distribution (e.g., 1.96 for a 95% CI).
This gives us another quick way to perform a hypothesis test for :
Decision Rule: If the 95% confidence interval for a coefficient does not contain 0, you can reject the null hypothesis at the 5% significance level.
The same PDF resource shows how to calculate and interpret this.
[PDF] Chapter 3 Generalized Linear Models (GLM)
Let's look at the same document again to see the connection to confidence intervals.
Read the section titled 'Wald CIs'. It shows the formula for the confidence interval and an example calculation. The key takeaway is that if '0' is not in the interval, the predictor is significant.
For the floor predictor in that example, the 95% CI is (0.064, 0.126). Since this interval does not include 0, we reject and conclude the predictor is significant, which is the same conclusion we reached with the z-statistic and p-value.
Conclusion
You now have a complete, practical framework for using the Wald test to evaluate individual predictors in a GLM. It is fast, intuitive, and relies on the output of a single model.
Key Takeaways:
- The Wald test assesses the significance of a single model parameter (e.g., ).
- The null hypothesis is typically .
- The test statistic is , which you can find directly in model output.
- Decision Rules: Reject if the p-value is small (e.g., < 0.05) or if the |z-statistic| is large (e.g., > 2).
- A significant result means the predictor has a meaningful effect on the response.
- Equivalently, if the 95% confidence interval for does not contain 0, the effect is significant at the 5% level.
In our last two lessons, we've covered the two most common methods for hypothesis testing in GLMs: the Likelihood Ratio Test for comparing models, and the Wald test for assessing individual predictors. In the next lesson, we will briefly cover a third method, the Score test, and then compare the properties of all three tests to give you a clear "when to use which" strategy for the exam.