Regression Knowledge-Based Study

Math · Data, Statistics & Probability · Math · Describing Data

Math topic explanations on Regression.

Study notes

  1. Understanding Bivariate Data

    When collecting data, we often record two quantitative characteristics for each individual or item. This type of information is called bivariate numerical data.

    To examine the relationship between two variables, we assign them specific roles:

    • Explanatory Variable (Independent Variable, xx): The variable that is suspected of causing, predicting, or explaining changes in the other. It is conventionally plotted on the horizontal axis.
    • Response Variable (Dependent Variable, yy): The variable whose outcome or variation is measured or predicted. It is conventionally plotted on the vertical axis.

    A scatter plot displays each observation as a single point (x,y)(x, y) on the Cartesian coordinate plane. Examining a scatter plot reveals three fundamental features of the relationship:

    1. Direction: A relationship is positive if larger values of xx tend to accompany larger values of yy. It is negative if larger values of xx correspond to smaller values of yy.
    2. Form: The pattern can be linear (following roughly a straight path) or non-linear (displaying curvature or clusters).
    3. Strength: How closely the points gather around a recognizable path or line.

    Defining the Line of Best Fit

    When a scatter plot shows a linear trend, we can model the relationship using a straight line called a regression line or line of best fit. The standard equation for this line is:

    y^=b1x+b0\hat{y} = b_1x + b_0

    where y^\hat{y} denotes the predicted value of the response variable for a given value of xx, b1b_1 represents the slope, and b0b_0 represents the yy-intercept.

    What is a Residual?

    Real-world data points rarely lie perfectly on a single line. For any observed data point (xi,yi)(x_i, y_i), the vertical distance between the observed value and the line's predicted value is known as a residual (error):

    Residual=yi−y^i=Observed y−Predicted y\text{Residual} = y_i - \hat{y}_i = \text{Observed } y - \text{Predicted } y
    • If a point lies above the regression line, yi>y^iy_i > \hat{y}_i, resulting in a positive residual.
    • If a point lies below the regression line, yi<y^iy_i < \hat{y}_i, resulting in a negative residual.
    • If an observed value matches the model prediction exactly, the residual is zero.

    The Least-Squares Criterion

    The unique line that minimizes the sum of all squared residuals, ∑(yi−y^i)2\sum (y_i - \hat{y}_i)^2, is called the ordinary least-squares (OLS) regression line. Squaring the residuals eliminates cancellation between positive and negative errors and penalizes larger discrepancies more heavily.

    Contextual Meaning of Model Parameters

    A regression equation is valuable only when its coefficients are interpreted accurately within the context of the underlying investigation.

    The Slope (b1b_1)

    The slope measures the rate of change of the predicted response per unit change in the explanatory variable:

    • For each increase of 11 unit in xx, the predicted response y^\hat{y} changes by b1b_1 units.
    • If b1>0b_1 > 0, the relationship is positive; as xx increases, y^\hat{y} increases.
    • If b1<0b_1 < 0, the relationship is negative; as xx increases, y^\hat{y} decreases.

    The Intercept (b0b_0)

    The yy-intercept is the predicted value of yy when x=0x = 0:

    y^=b1(0)+b0=b0\hat{y} = b_1(0) + b_0 = b_0

    Caution: Interpreting the intercept is only physically meaningful if:

    1. The explanatory variable xx can plausibly equal zero in the given context.
    2. The collected data include values of xx near zero.

    If values near zero fall far outside the observed range of xx, the intercept serves only as an anchoring constant for the linear geometry of the line and must not be given a literal physical interpretation.

    Using the Model to Make Predictions

    To predict the value of the response variable, substitute a specific value x∗x^* into the regression equation y^=b1x∗+b0\hat{y} = b_1x^* + b_0.

    Interpolation

    Interpolation occurs when you make a prediction for an explanatory value that lies within the range of the observed values of xx:

    min⁡(x)≤x∗≤max⁡(x)\min(x) \le x^* \le \max(x)

    Interpolation is generally considered reliable as long as the underlying linear pattern is strong and well-supported by the sample points.

    Extrapolation

    Extrapolation occurs when you use the model to predict yy for an explanatory value outside the domain of observed data:

    x∗<min⁡(x)orx∗>max⁡(x)x^* < \min(x) \quad \text{or} \quad x^* > \max(x)

    Extrapolation is hazardous and should be treated with extreme caution because we have no observational evidence that the linear relationship continues beyond the studied range. Patterns frequently level off, reverse direction, or change form entirely outside the measured interval.

    Comprehensive Worked Example

    A study recorded the study time in hours (xx) and the subsequent exam score out of 100 (yy) for a group of students whose study times ranged from 22 to 1010 hours. The calculated least-squares regression line is:

    y^=6.5x+38.0\hat{y} = 6.5x + 38.0

    Step-by-Step Analysis

    1. Interpreting the Slope: The slope is 6.56.5. This indicates that for each additional hour spent studying, the predicted exam score increases by 6.56.5 points.
    2. Interpreting the Intercept: The intercept is 38.038.0. For a student who studies 00 hours, the predicted exam score is 38.038.0 points (provided studying zero hours is plausible).
    3. Predicting within the Domain: For a student studying 66 hours:y^=6.5(6)+38.0=39.0+38.0=77.0 points\hat{y} = 6.5(6) + 38.0 = 39.0 + 38.0 = 77.0 \text{ points}Because 66 hours lies between 22 and 1010 hours, this is an interpolation.
    4. Calculating a Residual: Suppose a student who studied 66 hours actually achieved an exam score of 8181 points:Residual=y−y^=81−77.0=+4.0\text{Residual} = y - \hat{y} = 81 - 77.0 = +4.0The positive residual indicates that the student scored 4.04.0 points higher than predicted by the model (the model underpredicted the performance).
    5. Evaluating Extrapolation: Using the equation to predict the score of someone studying 2020 hours yields y^=6.5(20)+38.0=168\hat{y} = 6.5(20) + 38.0 = 168, which is impossible on a 100-point exam. This illustrates why extrapolation beyond the collected domain (22 to 1010 hours) produces invalid conclusions.