Introduction: Comparing Groups and Predicting the Future
In our previous studies, we looked at how to estimate parameters for a single group (like the average claim amount for a specific type of car insurance). But in the real world, actuaries often need to compare two different groups. For example, "Is the average claim cost for electric cars different from petrol cars?" or "Did our new safety training reduce workplace accidents compared to last year?"
In this chapter, we will learn how to construct Confidence Intervals (CIs) to compare two populations and Prediction Intervals (PIs) to estimate where a single future observation might fall. This is a core part of Statistical Inference, helping us move from "just guessing" to making mathematically sound conclusions.
1. Two-Sample Confidence Intervals: Independent Samples
When we have two separate, independent groups (e.g., Group A and Group B), we are usually interested in the difference between their means: \(\mu_1 - \mu_2\).
A. Normal Distributions (Means)
If our data comes from normal populations, the method depends on whether we know the variances (\(\sigma^2\)).
Case 1: Variances are known
The confidence interval for \(\mu_1 - \mu_2\) is:
\((\bar{X}_1 - \bar{X}_2) \pm z_{\alpha/2} \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}\)
Case 2: Variances are unknown but assumed equal
Since we don't know the variance, we "pool" our sample variances (\(s_1^2\) and \(s_2^2\)) together to get a better estimate, called the 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}\)
The interval then uses the t-distribution:
\((\bar{X}_1 - \bar{X}_2) \pm t_{n_1+n_2-2, \alpha/2} \sqrt{s_p^2 (\frac{1}{n_1} + \frac{1}{n_2})}\)
Quick Tip: If the confidence interval for the difference includes zero, it suggests there might be no significant difference between the two groups!
B. Binomial and Poisson (Using Normal Approximation)
For large samples, we can use the Normal distribution to approximate these intervals.
Binomial (Comparing Proportions):
To compare two probabilities, \(p_1 - p_2\), we use the sample proportions \(\hat{p}_1\) and \(\hat{p}_2\):
\((\hat{p}_1 - \hat{p}_2) \pm z_{\alpha/2} \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}\)
Poisson (Comparing Rates):
To compare two Poisson means \(\lambda_1 - \lambda_2\), we use the sample means \(\bar{X}_1\) and \(\bar{X}_2\):
\((\bar{X}_1 - \bar{X}_2) \pm z_{\alpha/2} \sqrt{\frac{\bar{X}_1}{n_1} + \frac{\bar{X}_2}{n_2}}\)
Key Takeaway: Two-sample intervals allow us to quantify the uncertainty when comparing two different populations.
2. Paired Data: The "Before and After" Scenario
Sometimes, samples are not independent. For example, if we measure the blood pressure of the same 10 people before and after they take a medication. These are "paired."
The Trick: Don't treat them as two samples. Instead, calculate the difference (\(D_i = X_i - Y_i\)) for each pair. Now you have one sample of differences!
The Confidence Interval for the mean difference \(\mu_D\) is just the standard one-sample t-interval:
\(\bar{D} \pm t_{n-1, \alpha/2} \frac{s_D}{\sqrt{n}}\)
Where:
\(\bar{D}\) is the average of the differences.
\(s_D\) is the standard deviation of the differences.
\(n\) is the number of pairs.
Common Mistake: Using the two-sample formula for paired data. This is a big "no-no" in exams because it ignores the correlation between the pairs!
3. Prediction Intervals (PIs)
Students often confuse Confidence Intervals with Prediction Intervals. Here is the difference:
- Confidence Interval: Estimating where the population mean (\(\mu\)) lies.
- Prediction Interval: Estimating where a single future observation (\(X_{next}\)) will fall.
Because an individual observation is much more "jumpy" (volatile) than a group average, a Prediction Interval is always wider than a Confidence Interval.
The Formula (for Normal data):
For a single future observation based on a sample of size \(n\):
\(\bar{X} \pm t_{n-1, \alpha/2} \cdot s \sqrt{1 + \frac{1}{n}}\)
Notice the extra "\(1\)" inside the square root? That accounts for the inherent randomness of a single new data point, in addition to our uncertainty about the mean.
Analogy: Imagine you are guessing the average height of students in a school (Confidence Interval). Now imagine you are guessing the height of the very next student to walk through the door (Prediction Interval). You’d need a wider range to be sure about the individual than the average!
4. The Bootstrap Method for Intervals
What if the data isn't Normal and we don't have a nice formula? We use The Bootstrap—a modern, computer-intensive method.
Step-by-Step Process:
1. Resample: Take a random sample from your original data with replacement (so the same value can appear twice). This new sample must be the same size as the original.
2. Calculate: Find the statistic of interest (like the mean or the difference in means) for this new sample.
3. Repeat: Do this thousands of times to create a "Bootstrap Distribution."
4. Find Percentiles: For a 95% confidence interval, find the 2.5th and 97.5th percentiles of your generated results.
Did you know? The Bootstrap is called that because you are "pulling yourself up by your own bootstraps"—using your own data to estimate the properties of the population without needing a theoretical formula.
5. Summary and Quick Review
Key Points to Remember:
- Independent Two-Sample: Use pooled variance if \(\sigma_1^2 = \sigma_2^2\). Use \(z\) for proportions/rates with large samples.
- Paired Samples: Always look for "before and after" or "matched" descriptions. Work with the differences (\(D\)).
- Prediction Interval: Used for one future value. It is wider than a CI because individuals are more variable than averages.
- Bootstrap: A resampling technique used when formulas are hard to find or distributions are unknown.
Exam Tip: In Paper B (the R exam), you might be asked to calculate these using code. In Paper A, you will likely use the Formulae and Tables (Orange Book) to find the correct t-distribution or z-distribution values. Always check your degrees of freedom (\(df\)) carefully!