Adding a Regression Line

See one more important piece of information that'll improve how we understand our data in its R-squared value.

We already saw how our plot showed a visible trend up and to the right. But, as we also saw, there were outliers. Can we be confident that the outliers are the exceptions and that the overall relationship between our two data sources is sound? There’s only so much we can assume based on visually viewing a graph. At some point, we’ll need complex numbers to describe what we’re looking at.

Linear regression

Simple linear regression analysis uses a mathematical formula to provide a number: y = mx + b where m is the slope of the line, and b is the y-intercept. This will give us a coefficient of determination (also described as R-squared or R^2) that measures the strength of the relationship between a dependent variable and the data model.

Get hands-on with 1400+ tech skills courses.