Linear Regression and Correlation

Linear Regression and Correlation

Linear regression and correlation describe how two numeric variables are related. This chapter reviews linear equations and scatter plots, shows how to fit a line of best fit through data using the regression equation, and explains how the correlation coefficient measures the strength and direction of a linear relationship.

Scatter Plots and Linear Equations

A relationship between two numeric variables is first explored with a scatter plot, which plots paired observations as points. If the points cluster around a straight line, the variables have an approximately linear relationship. A linear equation describes such a line through its slope and intercept: the slope gives the change in one variable for each unit change in the other, and the intercept gives the value where the line meets the vertical axis. The scatter plot shows whether a line is a reasonable summary.

The Regression Equation

The regression equation gives the line of best fit, the straight line that comes closest to all the points by making the total squared vertical distance from the points to the line as small as possible. This least-squares line can be used to predict the value of the dependent variable from a value of the independent variable. Predictions are most reliable within the range of the observed data, and extending the line far beyond that range can give misleading results.

The Correlation Coefficient

The correlation coefficient measures the strength and direction of the linear relationship between two variables. It ranges from negative one to positive one: values near positive one indicate a strong upward relationship, values near negative one a strong downward one, and values near zero little or no linear relationship. A value close to the extremes means the points lie near the line, while outliers, points far from the pattern, can distort both the line and the coefficient.