Fit a line of best fit to paired data and find its slope, intercept, and correlation. Enter the x and y values as two lists.
Usage Tip
An r near plus or minus 1 means points hug the line; near 0 means little linear relationship. Correlation is not causation.
intercept = mean y − slope × mean x
The correlation coefficient r, from −1 to 1, measures how strong and in which direction the relationship is.
The slope, intercept, and correlation r are reported.
r squared is the share of variation in y explained by x.
Linear regression finds the straight line that best fits a set of paired data by minimizing the squared vertical distance from the points to the line. The slope tells you how much y changes for each unit increase in x, and the intercept is the predicted y value when x is zero. The correlation coefficient measures how closely the points follow the line, from minus 1 to 1.
A strong correlation does not prove that one variable causes the other. Outliers can pull the line noticeably, and predictions far outside the range of your data, called extrapolation, are much less reliable than predictions inside it. Plot the data before relying on the fitted line.
