Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 26

Score Tests for GLM Parameters

Recommended resources

Hello! Welcome to the next lesson in our crash course on hypothesis testing in GLMs.

In our previous lessons, we explored two powerful methods for testing hypotheses:

  • The Likelihood Ratio Test (LRT), which compares the fit of two nested models but requires you to fit both.
  • The Wald test, which assesses the significance of a single predictor using the results from just one (the full) model.

Today, we'll introduce the third major testing framework: the Score test, also known as the Lagrange Multiplier (LM) test. This test has a unique computational advantage that makes it very useful in certain situations, particularly in model building.

Your learning outcome is to be able to describe the purpose and general procedure of a Score test for GLM parameters.

1. The Core Idea: What is the "Score"?

Before we discuss the test, we need to understand its name. In statistics, the score (or score vector) is the first derivative, or gradient, of the log-likelihood function with respect to the model parameters.

Given your background in computer science, you can think of this in terms of optimization. In machine learning, you often use gradient descent to find the minimum of a cost function. The process is similar here, but in Maximum Likelihood Estimation (MLE), we are trying to find the maximum of the log-likelihood function. At the very peak of the likelihood "hill," the gradient (the score) is zero.

To get a formal definition, please watch the first part of this video.

Score test (Lagrange Multiplier test) - introduction

This video from Ben Lambert introduces the concept of the score vector. Focus on understanding that the score is simply the derivative of the log-likelihood function.

Watch the first 1 minute and 19 seconds of the video. The key takeaway is the definition of the score vector as the collection of partial derivatives of the log-likelihood function with respect to each parameter.

So, the score measures how steep the log-likelihood function is at a particular set of parameter values . At the maximum likelihood estimate , the score is zero by definition: .


2. The Purpose and Intuition of the Score Test

The Score test uses this fact to test a null hypothesis. Let's consider a common null hypothesis, .

The intuition is:

  • If the null hypothesis is true (i.e., really is 0), then the model restricted to have should be very close to the best possible model.
  • This means the peak of the log-likelihood function should be near .
  • Therefore, the slope (the score) of the log-likelihood function evaluated at should be close to zero.

Conversely, if the slope at is very steep, it implies that the likelihood would increase significantly if we allowed to move away from 0. This provides strong evidence against the null hypothesis.

The following video segment explains this graphical intuition beautifully.

Score test (Lagrange Multiplier test) - introduction

Let's return to Ben Lambert's video to visualize the intuition behind the Score test. Pay close attention to how the steepness of the likelihood function at the null hypothesis value drives the test's conclusion.

Watch from 03:26 to 06:38. This part explains why a large score (steep gradient) at the null value suggests we should reject the null hypothesis.

This image provides a static view of the same concept, comparing the Score test to the Wald and LRT tests we've already covered.

Visual Comparison of Likelihood Ratio, Wald, and Score Tests
This diagram illustrates the geometric interpretation of the three tests. The Wald test measures the horizontal distance from the MLE (\(\hat{\theta}\)) to the null value (\(\theta_0\)). The LRT measures the vertical difference in log-likelihood. The **Score test measures the slope of the tangent line at the null value \(\theta_0\)**.

3. The General Procedure and Key Advantage

The most important feature of the Score test—and its primary advantage—is that it only requires fitting the simpler, restricted model (i.e., the model under the null hypothesis).

Here is the general procedure for testing if a set of parameters is zero:

  1. State the Hypotheses:

    • : The parameters in question are zero. This defines the restricted model.
    • : At least one of the parameters is not zero. This corresponds to the full model.
  2. Fit the Restricted Model: Fit the GLM that omits the predictor(s) you are testing. For example, if you are testing if and are zero, you would fit the model response ~ other_predictors.

  3. Calculate the Test Statistic: This is the crucial step. The Score test statistic is calculated using:

    • The score vector from the full model's log-likelihood, but evaluated at the parameter estimates from the restricted model.
    • The Fisher information matrix , which is essentially the variance-covariance matrix of the parameters. This is also evaluated at the estimates from the restricted model.

The general form of the multivariate Score statistic is:

where are the parameter estimates from the restricted (null) model. Under , this statistic follows a Chi-square distribution with degrees of freedom equal to the number of parameters being tested.

Don't worry about calculating this by hand. The key takeaway is that every component is calculated using only the results of the simpler, restricted model.

This next reading from UCLA Statistics explains this practical advantage very clearly.

How are the likelihood ratio, Wald, and Lagrange multiplier (score) tests different and/or similar?

This page from UCLA provides a fantastic, application-focused description of the Score test. It emphasizes its main advantage and common use case.

Read the section titled 'The Lagrange multiplier or score test'. Focus on the key phrases: 'requires estimating only a single model' and 'the model estimated does not include the parameter(s) of interest'. This section also refers to it as a 'test for omitted variables', which is a perfect description of its most common use.

Because you only need to fit the simple model, the Score test is computationally efficient. It's ideal for situations in model selection where you have a simple model and want to quickly test whether adding a large group of new candidate predictors would be worthwhile, without having to fit that complex new model. In R, you can perform a Score test using the anova() function with the argument test = "Rao".


Conclusion

You have now been introduced to the three main pillars of hypothesis testing in GLMs: the Likelihood Ratio, Wald, and Score tests.

Key Takeaways for the Score Test:

  • Purpose: The Score test assesses if a set of parameters can be fixed to their null-hypothesized values (usually zero).
  • Core Idea: It checks if the slope (score) of the log-likelihood function is significantly different from zero when evaluated at the parameter values specified by the null hypothesis.
  • General Procedure: Fit the simpler, restricted model (under ) and use its estimates to calculate the score and information matrix of the full model.
  • Key Advantage: It is computationally efficient because it does not require fitting the full, more complex model. This makes it an excellent "omitted variable" test.

In the final lesson of this module, we will bring everything together. We will compare the properties of the Likelihood Ratio, Wald, and Score tests to give you a clear "when to use which" strategy for your exam.