Welcome to Hypothesis Testing & Goodness of Fit!
In the previous chapters of CS1, we learned how to estimate numbers, like the average claim size or the probability of a car accident. But in the real world, actuaries don't just want to estimate numbers—they want to make decisions. Is this new drug more effective than the old one? Is the number of claims actually following a Poisson distribution? Is there a difference between male and female driving risks?
Hypothesis testing is the formal "rulebook" for making these decisions using data. Don't worry if it seems a bit abstract at first; once you grasp the logic, it’s like being a detective in a courtroom!
1. The Logic of Hypothesis Testing
Think of a hypothesis test like a courtroom trial. In a trial, a person is "innocent until proven guilty." In statistics, our "innocent" state is called the Null Hypothesis.
The Two Rival Hypotheses
1. Null Hypothesis (\(H_0\)): This is the "boring" state. It assumes that nothing has changed, or there is no effect. We assume this is true unless we have strong evidence otherwise.
2. Alternative Hypothesis (\(H_1\)): This is what you are trying to prove. It's the "exciting" claim (e.g., "The new insurance premium is actually lower").
The 5-Step Process
To pass your CS1 exam, follow these steps every time:
1. State \(H_0\) and \(H_1\) clearly.
2. Choose a Significance Level (\(\alpha\))—usually 5% or 1%.
3. Calculate the Test Statistic (your evidence from the data).
4. Find the P-value or the Critical Value.
5. Make a decision: "Reject \(H_0\)" or "Fail to reject \(H_0\)."
Key Takeaway
We never "accept" the null hypothesis. We either reject it because the evidence is strong, or we fail to reject it because the evidence is too weak. It’s like a jury saying "Not Guilty"—it doesn't necessarily mean the person is innocent; it just means there wasn't enough proof to convict them.
2. Errors: When Tests Go Wrong
Because we are using samples (and not the whole population), we might make a mistake. There are two types:
Type I Error (\(\alpha\)): The "False Alarm." You reject \(H_0\) when it was actually true. (Think: Convicting an innocent person).
Type II Error (\(\beta\)): The "Missed Opportunity." You fail to reject \(H_0\) when it was actually false. (Think: Letting a guilty person go free).
Memory Aid: The "RT" Mnemonic
Type I is Rejecting a True \(H_0\). Just remember RT (like "Real Truth" being rejected).
3. Testing the Mean (\(\mu\))
This is the most common test in the CS1 syllabus. We want to know if the population mean is equal to a specific value.
Scenario A: Variance (\(\sigma^2\)) is Known
We use the Z-test. The test statistic is:
\(Z = \frac{\bar{X} - \mu_0}{\sigma / \sqrt{n}}\)
Where \(\bar{X}\) is your sample mean and \(n\) is the sample size.
Scenario B: Variance is Unknown
This is more realistic. Since we don't know \(\sigma\), we use the sample standard deviation (\(s\)) and the t-distribution with \(n-1\) degrees of freedom.
\(t = \frac{\bar{X} - \mu_0}{s / \sqrt{n}}\)
Quick Review: One-Tailed vs. Two-Tailed
- Use Two-Tailed if you are checking if the mean is simply "different" (\(H_1: \mu \neq \mu_0\)).
- Use One-Tailed if you are checking if it is "greater than" or "less than" (\(H_1: \mu > \mu_0\) or \(H_1: \mu < \mu_0\)).
4. Comparing Two Groups
As an actuary, you might compare two groups (e.g., claims from Group A vs. Group B).
Two-Sample t-test (Independent)
If we assume both groups have the same variance, we calculate a Pooled Sample Variance (\(s_p^2\)):
\(s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1 + n_2 - 2}\)
Then the test statistic is:
\(t = \frac{\bar{X}_1 - \bar{X}_2}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}\)
Paired t-test (Dependent)
Use this when the data comes in pairs (e.g., the weight of 10 people before and after a diet). We simply calculate the differences (\(d\)) for each pair and perform a one-sample t-test on those differences.
5. The Chi-Square (\(\chi^2\)) Goodness of Fit Test
This test checks if your data actually "fits" a theoretical distribution (like the Binomial, Poisson, or Normal). It's essentially checking: "Is the difference between what I saw and what I expected just luck, or is my model wrong?"
The Formula
\(\chi^2 = \sum \frac{(O_i - E_i)^2}{E_i}\)
Where:
\(O_i\) = Observed frequency (the actual data).
\(E_i\) = Expected frequency (calculated using the distribution you are testing).
Important Rules for Goodness of Fit
1. Minimum Frequency: Every Expected frequency (\(E_i\)) should be at least 5. If it's smaller, you must group adjacent cells together.
2. Degrees of Freedom (\(df\)): This is vital!
\(df = (\text{number of groups}) - 1 - (\text{number of parameters estimated})\)
Example: If you estimate the mean (\(\lambda\)) for a Poisson distribution from the data, you subtract an extra 1 from your \(df\).
Did you know?
The Chi-square test is always one-sided (right-tailed). Why? Because the formula squares the differences, so the result is always positive. A very large \(\chi^2\) value means the "distance" between reality and your model is huge—so you reject the model!
6. Contingency Tables (Independence)
We use this to see if two factors are related. For example: "Is the type of car insurance claim related to the age of the driver?"
We arrange the data in a grid. The Expected Frequency for any cell is:
\(E = \frac{\text{Row Total} \times \text{Column Total}}{\text{Grand Total}}\)
Degrees of Freedom for tables:
\(df = (r - 1) \times (c - 1)\)
Where \(r\) is the number of rows and \(c\) is the number of columns.
7. Summary & Common Pitfalls
Common Mistake 1: Forgetting to group cells in a \(\chi^2\) test when \(E_i < 5\). This is a classic exam trap!
Common Mistake 2: Using the wrong degrees of freedom. Always double-check if you estimated any parameters (like \(\mu\) or \(\sigma\)) from the data.
Common Mistake 3: Confusing the Z-test and T-test. Just remember: Variance known? Z. Variance unknown? T.
Final Encouragement
Don't worry if the formulas look intimidating. In the exam, the steps are very repetitive. If you can master the 5-step process and get your degrees of freedom right, you are well on your way to passing CS1! Keep practicing those past paper questions—they are the key to seeing how these tests are applied in actuarial contexts.