Skip to main content

Welcome to a Grasp lesson

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

Lesson 42

Statistical Tests for Data Adherence

Recommended resources

Introduction

In our last lesson, we explored sophisticated methods like P-splines to create a smooth, graduated mortality curve from raw data. This process, as we discussed, involves a delicate balance between adherence to the data and the smoothness of the resulting curve. Having constructed our graduation, a critical question remains: how good is it? Is the fit statistically sound, or have we strayed too far from the original observations?

This lesson marks our transition from creating graduations to evaluating them. We will focus specifically on assessing the adherence to data, which is arguably the most fundamental check. You will learn to apply two key statistical tests for this purpose: the Chi-squared test and the Standardised Deviations test. Given your background in statistics, you'll recognize the foundational principles behind these tests, which we will apply within the specific context of mortality graduation.


The Foundation: Standardised Deviations

Before we can test anything, we need a way to measure the "error" or deviation at each age. We don't just look at the raw difference between observed deaths and the deaths predicted by our graduation. Instead, we standardize this difference by its expected standard deviation. This gives us the standardised deviation, , for each age .

Under the null hypothesis () that our graduated rates ( or ) are the true, underlying rates for the population, the number of observed deaths, , can be modeled. For instance, using a Poisson model, is a realization of a random variable , where is the central exposed to risk. The mean and variance are both .

This allows us to construct a standardised test statistic for each age:

For a large enough number of expected deaths, the Central Limit Theorem implies that this will be approximately a standard normal random variable, . The calculated value for our specific data is denoted . This value is the fundamental building block for the tests we will explore.

The following document formally defines this statistic for different underlying models.

[PDF] 4 Testing Hypotheses

This document from the University of Oxford provides the statistical basis for the tests we are about to perform.

Please read the section leading up to and including the formulas for the test statistics. Focus on how the standardised deviation, denoted z_x, is constructed for both the Binomial model and the Poisson/2-state model. The key insight is that in both cases, the statistic is of the form \frac{O-E}{\sqrt{V}} and is expected to follow a standard normal distribution under the null hypothesis.


The Chi-Squared Test: An Overall Measure of Fit

The Chi-squared test provides an aggregate measure of adherence across all ages. Since you know that each is approximately a standard normal variate, what happens when we square them and add them up? You've got it: the result is a Chi-squared distributed variable.

The test proceeds as follows:

  1. Null Hypothesis (): The graduated rates are the true underlying rates for the population (i.e., the graduation provides a good fit).
  2. Alternative Hypothesis (): The graduated rates are not the true rates.
  3. Test Statistic: We calculate the statistic .
  4. Distribution under : , where is the degrees of freedom.
  5. Degrees of Freedom (): This is a crucial step. The degrees of freedom are the number of age groups being tested () minus the number of parameters () that were estimated to produce the graduation.
    • For a parametric graduation (e.g., Gompertz with 2 parameters), .
    • For a spline graduation, would be the number of spline parameters or effective degrees of freedom.
  6. Decision Rule: We compare our calculated to the critical value from the distribution at a chosen significance level (e.g., 5%). Since we are squaring deviations, only large positive values of suggest a poor fit, making this an upper-tailed test. If , we reject .

The following video gives a great general introduction to the Chi-squared goodness-of-fit test.

Chi Square Test

This video from The Organic Chemistry Tutor provides a clear, step-by-step example of a Chi-squared test. While the example is not actuarial, the statistical procedure is identical.

Please watch the following segments to refresh your understanding of the process: Setting up hypotheses for a goodness-of-fit test. Calculating degrees of freedom, which is n-1 in this simple case. Calculating the test statistic using the familiar \sum \frac{(O-E)^2}{E} formula. Note that in our actuarial context, \sum z_x^2 is equivalent to this. Making a conclusion by comparing the calculated value to the critical value.

Now, let's see this applied in an actuarial context. The following resource shows a worked example from an actual exam paper.

[PDF] Subject CS2 Paper A - Institute of Actuaries of India

This document from the Institute of Actuaries of India shows the application of the Chi-squared test to assess a graduation.

Please read the section titled "Chi Square Test" starting from subsection (iv). Pay close attention to the practical steps: The statement of the null hypothesis. The calculation of the test statistic by summing the squared deviations. The calculation of the degrees of freedom (21 ages minus 4 estimated parameters). The final conclusion based on comparing the test statistic to the critical value.

Disadvantages of the Chi-Squared Test

While powerful, the Chi-squared test is not perfect. It gives a single summary number, which can hide important details. The document from Oxford University you reviewed earlier also lists these drawbacks.

[PDF] 4 Testing Hypotheses

Let's revisit the Oxford University document to understand the limitations of this test.

Please read the list of "Disadvantages" under heading "(A) χ2 test.". The key issues are that it might not detect a few very large deviations if they are offset by good agreement elsewhere, and it is insensitive to systematic bias (e.g., all deviations being of the same sign).

This second point—insensitivity to bias—is what motivates the tests we will cover in the next lesson.


The Standardised Deviations Test

To address the first disadvantage of the Chi-squared test (that individual large deviations might be overlooked), we can use the Standardised Deviations test.

The logic is elegant: if the values are truly from a standard normal distribution, then their own distribution should look like it. We can test this formally using... another Chi-squared goodness-of-fit test!

The procedure is:

  1. Calculate the for all age groups.
  2. Divide the range of possible values into several bins (e.g., , , , etc.).
  3. For each bin, count the observed number of values that fall into it.
  4. For each bin, calculate the expected number of values. This is , where is the probability of a standard normal variable falling into that bin. For example, the probability for the bin is approximately 0.3413.
  5. Calculate the Pearson's Chi-squared statistic: .
  6. Compare this statistic to a distribution with (number of bins - 1) degrees of freedom.
This image illustrates the concept behind the Standardised Deviations Test. The instructor is pointing to a standard normal curve, which shows the theoretical percentage of observations expected in each standard deviation interval (e.g., 34% between 0 and 1). The table below likely compares these expected counts to the observed counts of calculated z-scores, which forms the basis of the test.

Let's see the formal description of this test.

[PDF] 4 Testing Hypotheses

The Oxford University document provides a concise summary of this test.

Please read section "(B) Standardised deviations test". It outlines the exact procedure we just discussed, from dividing the range of zx values to using Pearson's statistic. Also note the important practical caveat at the end: this test is rarely appropriate because the total number of age groups, m, is often too small to yield reliable expected counts in each bin.


Conclusion

In this lesson, we have equipped ourselves with the primary tools for checking whether a graduation adheres to the observed data. This is the first and most important step in assessing the quality of our work.

Key Takeaways:

  • Standardised Deviation (): The foundational unit for adherence tests. It measures the difference between observed and expected deaths in units of standard deviation. Under the null hypothesis, it follows an distribution.
  • Chi-Squared Test: An aggregate test that sums the squares of the standardised deviations (). It tests for the overall size of deviations across all ages. A large value indicates a poor fit.
  • Degrees of Freedom: The calculation for the Chi-squared test must account for the number of parameters estimated in the graduation: .
  • Standardised Deviations Test: A more granular test that checks if the distribution of the values themselves conforms to a standard normal distribution. It does this by grouping the values into bins and performing a Pearson's Chi-squared test.

Preview of the Next Lesson

While the Chi-squared and Standardised Deviations tests are excellent for assessing the magnitude of errors, they are not designed to detect systematic patterns. For example, a graduation could have small deviations that are consistently positive, indicating a bias that these tests would miss. In our next lesson, we will explore a suite of tests designed specifically to detect such patterns, including the Signs Test, the Grouping of Signs Test, and tests for Serial Correlations.