Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Linear regression and correlation describe relationships between two quantitative variables. This cheat sheet helps students read scatterplots, measure association, write prediction equations, and judge whether a model is reasonable. It is useful for homework, tests, labs, and data projects where students must connect calculations to real context.

The main regression model is the least-squares line y^=a+bx\hat{y}=a+bx, where bb is the slope and aa is the intercept. Correlation rr measures the strength and direction of a linear relationship, while r2r^2 describes the proportion of variation explained by the model. Residuals, written e=yy^e=y-\hat{y}, show prediction error and help check whether a linear model fits the data well.

Key Facts

  • The least-squares regression line has the form y^=a+bx\hat{y}=a+bx, where y^\hat{y} is the predicted response, aa is the intercept, and bb is the slope.
  • The slope of the regression line is b=rsysxb=r\frac{s_y}{s_x}, where rr is correlation and sxs_x and sys_y are the sample standard deviations.
  • The intercept is a=yˉbxˉa=\bar{y}-b\bar{x}, so the regression line always passes through the point (xˉ,yˉ)(\bar{x},\bar{y}).
  • The correlation coefficient is r=1n1(xixˉsx)(yiyˉsy)r=\frac{1}{n-1}\sum \left(\frac{x_i-\bar{x}}{s_x}\right)\left(\frac{y_i-\bar{y}}{s_y}\right) and satisfies 1r1-1\le r\le 1.
  • A residual is ei=yiy^ie_i=y_i-\hat{y}_i, and positive residuals mean the actual value is above the predicted value.
  • The least-squares line minimizes the sum of squared residuals, written (yiy^i)2\sum (y_i-\hat{y}_i)^2.
  • The coefficient of determination is r2r^2, which gives the proportion of variation in yy explained by the linear relationship with xx.
  • Use a regression line for interpolation within the data range, but avoid extrapolation far outside the observed xx values.

Vocabulary

Scatterplot
A graph of paired quantitative data values (x,y)(x,y) used to show the form, direction, strength, and outliers in a relationship.
Correlation coefficient
The number rr that measures the direction and strength of a linear association between two quantitative variables.
Least-squares regression line
The line y^=a+bx\hat{y}=a+bx that minimizes the sum of squared residuals for a set of data.
Residual
A residual is the prediction error e=yy^e=y-\hat{y} for one data point.
Coefficient of determination
The value r2r^2 is the proportion of variation in the response variable explained by the regression model.
Extrapolation
Extrapolation is using a regression model to predict values outside the range of the original data.

Common Mistakes to Avoid

  • Using correlation to prove causation is wrong because a strong value of rr only shows linear association, not that one variable causes the other.
  • Forgetting the context of the slope is wrong because bb means the predicted change in yy for each increase of 11 unit in xx.
  • Mixing up yy and y^\hat{y} is wrong because yy is an observed value, while y^\hat{y} is a predicted value from the regression line.
  • Ignoring residual plots is wrong because a curved residual pattern suggests that a linear model may not be appropriate.
  • Extrapolating far beyond the data is wrong because the linear pattern may not continue outside the observed range of xx values.

Practice Questions

  1. 1 A regression line is y^=12+3.5x\hat{y}=12+3.5x. What is the predicted value of yy when x=8x=8, and what does the slope mean in context?
  2. 2 For one data point, y=42y=42 and y^=38\hat{y}=38. Find the residual e=yy^e=y-\hat{y} and explain whether the prediction was too high or too low.
  3. 3 A data set has r=0.82r=-0.82. Find r2r^2 and interpret what it says about the linear model.
  4. 4 A scatterplot shows a strong curved pattern, but the correlation is close to 00. Explain why a low correlation does not always mean there is no relationship.

Understanding Linear Regression & Correlation

A scatterplot should be studied before any calculation. Look for an overall straight-line pattern, but notice the spread around that pattern. A strong relationship has points packed fairly close to a line.

A weak relationship has more vertical spread. Direction matters because an upward trend means larger input values tend to go with larger response values. A downward trend means the response tends to fall as the input rises.

The relationship can be real without being linear. Curved data, clusters, or a spread that widens from left to right need more care than one straight fitted line can provide.

The slope has units, which gives it a practical meaning. If a model uses hours studied to predict test score, the slope describes the predicted score change for one extra hour studied. This is more useful than treating slope as a bare number.

The intercept can be less useful. It describes a prediction when the input is zero, but zero may be outside the observed data or may not make sense in context.

For example, a model relating adult height to body mass should not be interpreted at a height of zero. Always state what one unit of each variable means before interpreting a result.

Correlation is not proof that one variable causes the other. Ice cream sales and sunburn cases can rise together because warm weather affects both. A third variable like temperature can create an association.

Sometimes the direction of cause may even run the other way. Regression can summarize a pattern and make a conditional prediction, but it cannot settle a cause and effect claim by itself. Strong causal conclusions need a well-designed experiment, careful controls, or strong evidence from several sources.

Residuals reveal details that a correlation value can hide. A good residual plot has points scattered randomly above and below zero with roughly similar spread across the input values. A curved residual pattern suggests that the line misses a curved relationship.

A funnel shape suggests changing variability, so predictions are less equally reliable across the range. One unusual point can pull the fitted line toward itself, especially when it lies far left or right from the other input values.

Such a high-leverage point deserves investigation. It may be a recording error, an unusual but valid case, or evidence that one simple model is not enough.

Predictions are estimates, not guaranteed outcomes. A large value of r squared means the line accounts for much of the observed variation, yet individual cases may still differ noticeably from their predictions. Check the original data range before using the model.

Interpolation is usually safer because it predicts among values already observed. Extrapolation can fail when conditions change beyond the data.

Students often lose marks by reporting a precise prediction without mentioning its uncertainty, units, or sensible range. A clear conclusion names the variables, gives the predicted change or value, and states the limits of the model.