BackLeast Squares Regression and Correlation: Study Notes
Study Guide - Smart Notes
Tailored notes based on your materials, expanded with key definitions, examples, and context.
Least Squares Regression
Introduction to Regression
Regression analysis is a statistical method used to examine the relationship between an explanatory variable (x) and a response variable (y). When these variables appear to have a linear association, a regression line can summarize their relationship and be used for prediction.
Regression line: Describes how y changes with x.
Prediction: Allows estimation of y for a given x.
Explanatory vs. Response: In regression, it is essential to specify which variable is explanatory and which is response.
Equation of a Straight Line
The general equation for a straight line in the (x,y)-plane is:
Equation:
y-intercept (): The value of y when x = 0.
Slope (): The change in y for a one-unit increase in x; units are (units of y)/(units of x).
Interpretation: An increase of 1 unit in x produces an increase of units in y.
Least-Squares Regression Line
The least-squares regression line is the line that minimizes the sum of the squared vertical distances (errors or residuals) between the observed values and the predicted values.
Equation:
Predicted value (): For any x, is the value on the regression line, not necessarily an observed value.
Residual: The difference between the observed value and the predicted value:
Minimization criterion: The least-squares regression line minimizes:
Finding the Least-Squares Regression Line
To find the best-fitting line, we use summary statistics and the correlation coefficient:
Slope:
Intercept:
Where is the correlation coefficient, and are the standard deviations of x and y, and , are their means.
Worked Example: Golf Club Speed vs Distance
Given data for club-head speed and distance traveled by a golf ball:
Club-head Speed (mph) | Distance (yards) |
|---|---|
100 | 257 |
102 | 264 |
103 | 274 |
105 | 275 |
99 | 258 |
101 | 266 |
115 | 279 |
109 | 289 |
Step 1: Select two points, e.g., (99, 258) and (105, 275).
Step 2: Calculate the slope using the point-slope formula:
Step 3: Find the equation of the line:
Step 4: Predict distance for club-head speed of 104 mph:
yards
Least-Squares Regression Line Using All Data
Using all data and summary statistics:
Regression equation:
Prediction for x = 103:
yards
Residual calculation:
Observed value: 274 yards Residual: yards (above average)
Correlation and Regression
Correlation measures the strength and direction of a linear relationship between two variables. Regression quantifies the relationship and allows prediction.
Correlation coefficient (): Ranges from -1 to 1.
Effect of adding points: Adding an outlier can change the value of significantly.
Switching Explanatory and Response Variables
If we exchange explanatory and response variables, the correlation coefficient remains the same, but the regression line changes. The least-squares regression line minimizes vertical distances; switching variables would minimize horizontal distances.
Solid line: Predicts y for a given x.
Dashed line: Predicts x for a given y.
Interpretation of Slope and Intercept
Slope: Indicates the average change in the response variable for a one-unit increase in the explanatory variable. Interpretation is probabilistic, not deterministic.
If club-head speed increases by 1 mph, the expected distance increases by 3.1661 yards.
Intercept: Represents the predicted value of y when x = 0. Only interpret if x = 0 is reasonable and observed in the data.
Scope of the Model
Predictions should only be made within the range of observed values for the explanatory variable. Extrapolation outside this range is unreliable.
Do not use the regression line to predict for x values much larger or smaller than those observed.
Comparison of Linear Approximations
Different methods of fitting a line (using two points vs. least-squares regression) can yield different equations. Least-squares regression is preferred for minimizing overall error.
Practice: Calculating Regression Line from Summary Statistics
Given , , , , :
Regression equation:
Recap: Calculation of Correlation
Correlation is calculated using the formula:
i | x_i | y_i | (x_i - \bar{x}) | (y_i - \bar{y}) | product |
|---|---|---|---|---|---|
1 | 2 | 5 | -1 | +1.17 | -1.28 |
2 | 3 | 2 | 0 | -0.83 | 0 |
3 | 4 | 4 | +1 | +0.65 | +0.65 |
Additional info: Table used for step-by-step calculation of . | |||||
Key Points Summary
Least-squares regression line minimizes the sum of squared residuals.
Regression equation allows prediction of response variable from explanatory variable.
Interpretation of slope and intercept must consider the context and scope of the data.
Correlation quantifies strength and direction of linear relationship.
Extrapolation outside observed data range is not recommended.