Introduction: Moving Beyond the "Best Fit" Line

In the previous chapter, we learned how to draw a "best fit" line through a scatterplot using Least Squares Estimation. But as actuaries, we can’t just draw a line and hope for the best! We need to know: Is this relationship actually real, or just a coincidence? How well does our model actually fit the data? And if we use this model to predict the future, how much can we trust it?

In this chapter, we move from just "drawing lines" to statistical inference. We will learn how to test our results and put "error bars" around our predictions. Don't worry if the formulas look a bit intimidating at first—we’ll break them down step-by-step!


1. Inference on the Slope Parameter (\(\beta\))

The slope (\(\beta\)) is the heart of our regression model. It tells us how much the response variable (\(Y\)) changes for every one-unit increase in the explanatory variable (\(X\)).

Is the Slope Significant?

In actuarial work, we often test the Null Hypothesis \(H_0: \beta = 0\). If the slope is zero, it means the explanatory variable has no effect on the response. If we "reject the null," we are saying there is statistical evidence of a relationship.

The Standard Error of the Slope

To test the slope, we first need to know its Standard Error, denoted as \(se(\hat{\beta})\). This measures how much the estimate \(\hat{\beta}\) would vary if we took many different samples.

\(se(\hat{\beta}) = \sqrt{\frac{\hat{\sigma}^2}{S_{xx}}}\)

Where:

  • \(\hat{\sigma}^2\) is the estimated residual variance (often called the Residual Mean Square).
  • \(S_{xx}\) is the sum of squares of the \(x\)-values, calculated as \(\sum (x_i - \bar{x})^2\).

The t-test for the Slope

Because we have to estimate the variance \(\sigma^2\), we use the t-distribution rather than the normal distribution. The test statistic is:

\(t = \frac{\hat{\beta} - \text{hypothesized value}}{se(\hat{\beta})}\)

For a standard test of significance (\(H_0: \beta = 0\)), this simplifies to \(t = \frac{\hat{\beta}}{se(\hat{\beta})}\). We compare this to a t-distribution with \(n - 2\) degrees of freedom.

Quick Tip: If the absolute value of your \(t\)-statistic is large (usually greater than 2 for most sample sizes), the p-value will be small, and the slope is likely significant!


2. Measures of Goodness of Fit

Even if a slope is significant, the model might still be poor. Goodness of Fit tells us how much of the "story" our model actually explains.

The Coefficient of Determination (\(R^2\))

The most common measure is \(R^2\). It represents the proportion of the total variation in the response variable that is explained by the regression model.

\(R^2 = \frac{SSR}{SST} = 1 - \frac{SSE}{SST}\)

Where:

  • SST (Total Sum of Squares): Total variation in the data.
  • SSR (Regression Sum of Squares): Variation explained by our line.
  • SSE (Error Sum of Squares): Variation the line missed (the residuals).

Interpreting \(R^2\):

  • \(R^2 = 1\): Perfect fit! All data points lie exactly on the line.
  • \(R^2 = 0\): The model explains nothing; the explanatory variable is useless.
  • Actuarial Note: In social sciences or complex insurance claims data, even an \(R^2\) of 0.2 or 0.3 can be considered useful, whereas in physical sciences, we look for 0.9+.

Did you know? In a simple linear regression (one \(X\) and one \(Y\)), \(R^2\) is simply the square of Pearson's correlation coefficient (\(r\)). So if \(r = 0.7\), then \(R^2 = 0.49\).


3. Prediction Intervals: Mean vs. Individual

Once we have a fitted model \(\hat{y} = \hat{\alpha} + \hat{\beta}x\), we can use it to predict future values. However, there are two different types of predictions, and it's vital to know the difference!

A. Confidence Interval for the Mean Response

This is used when we want to estimate the average value of \(Y\) for a specific value of \(x_0\). For example: "What is the average claim size for all policyholders aged 40?"

Because we are averaging out individual quirks, the uncertainty is smaller.

B. Prediction Interval for an Individual Response

This is used when we want to predict the value of \(Y\) for a single new observation. For example: "What is the specific claim size for Mr. Smith, who is aged 40?"

The Golden Rule: The Prediction Interval for an individual is always wider than the Confidence Interval for the mean. Why? Because an individual has all the uncertainty of the "average" PLUS their own individual random variation (\(\epsilon\)).

The "Extra 1" Trick:
The variance for the mean response involves a term like \([ \dots ]\).
The variance for the individual response involves the term \([ 1 + \dots ]\).
That extra "1" represents the inherent variance of a single observation (\(\sigma^2\)).


4. Using Software (R) and Interpreting Output

In Paper B, you won't be calculating these by hand; you’ll use R. You need to be able to read the summary() output of a linear model (lm).

Key items to look for in R output:

  • Coefficients Table: Look at the Estimate column for \(\hat{\beta}\) and the Pr(>|t|) column for the p-value.
  • Residual standard error: This is your \(\hat{\sigma}\).
  • Multiple R-squared: This is your \(R^2\) value.

Example command for prediction:
predict(model, newdata, interval = "confidence") — for the mean.
predict(model, newdata, interval = "prediction") — for the individual.


Quick Review: Common Mistakes to Avoid

  • Confusing \(R^2\) with Correlation: Remember that \(R^2\) doesn't tell you the direction of the relationship (positive or negative), only the strength. Correlation (\(r\)) tells you both.
  • Degrees of Freedom: In simple linear regression, always use \(n - 2\) degrees of freedom for your t-tests and intervals. The "2" represents the two parameters we estimated (\(\alpha\) and \(\beta\)).
  • Extrapolation: Be careful using the model to predict values of \(x\) far outside the range of your original data. The "goodness of fit" might not hold out there!

Key Takeaway: Inference allows us to quantify our uncertainty. We use t-tests to check the slope, \(R^2\) to check the model fit, and Prediction Intervals to forecast future values while accounting for randomness.