No history yet

Introduction to Correlation and Line of Best Fit

Spotting Relationships in Data

We're constantly looking for connections in the world. Does more rain lead to taller trees? Do higher ad spends result in more sales? The first step in answering such questions is to visualize the data we have. A scatter plot is a simple but powerful tool for this job.

Imagine we're tracking the hours a student studies and the score they get on a test. Each student becomes a single dot on our graph, positioned by their study hours (on the x-axis) and their test score (on the y-axis). When we plot all the students, we can start to see a pattern emerge.

Just by looking, we can see a trend: as study hours go up, test scores tend to go up as well. This visual gives us a hunch, but it doesn't tell us how strong the relationship is. For that, we need a number.

Measuring the Connection

The correlation coefficient, often written as rr, is a single number that measures the strength and direction of a linear relationship between two variables. It ranges from -1 to +1.

  • Positive Correlation (r>0r > 0): When one variable increases, the other tends to increase. Think of temperature and ice cream sales. A correlation of +1 means a perfect positive straight line.

  • Negative Correlation (r<0r < 0): When one variable increases, the other tends to decrease. For example, the number of hours you watch TV might have a negative correlation with your test scores. A correlation of -1 means a perfect negative straight line.

  • No Correlation (r0r \approx 0): There's no linear relationship between the variables. Your shoe size and your IQ, for instance, have a correlation close to zero.

Correlation (r)Strength of Relationship
-1.0 to -0.7 or 0.7 to 1.0Strong
-0.7 to -0.4 or 0.4 to 0.7Moderate
-0.4 to -0.2 or 0.2 to 0.4Weak
-0.2 to 0.2None or Very Weak

The coefficient tells us how tightly the data points cluster around a straight line. The closer rr is to 1 or -1, the more the points resemble a perfectly straight line.

The Line of Best Fit

While a scatter plot shows us the individual data points, we often want to summarize the relationship with a single line. This is called the line of best fit or regression line.

This line is drawn through the data points in a way that minimizes the overall distance from all the points. It acts as a summary of the trend, giving us a simple model of the relationship between the two variables. We can even use it to make general predictions. For example, we could use the line to estimate the test score for a student who studied for a specific number of hours.

A Word of Caution

Correlation is a useful tool, but it comes with a critical warning: correlation does not imply causation. Just because two variables move together doesn't mean one causes the other.

For example, ice cream sales and shark attacks are positively correlated. When ice cream sales go up, so do shark attacks. But does eating ice cream cause shark attacks? Of course not. A third factor, hot weather, causes both.

Another limitation is that the correlation coefficient only measures linear relationships. A dataset can have a very strong, clear pattern, but if that pattern isn't a straight line, the correlation coefficient could be close to 0. For example, if we look at a car's speed and its fuel efficiency, the relationship might look like a curve, not a line.

Understanding these basic concepts of correlation and the line of best fit is the first step toward building more complex models that can help us understand the world.

Ready to check your understanding?

Quiz Questions 1/6

What is the primary purpose of a scatter plot in data analysis?

Quiz Questions 2/6

A researcher finds a correlation coefficient of r=0.85r = -0.85 between the number of hours a person watches TV per week and the number of hours they exercise. How would you interpret this?

By visualizing data and quantifying relationships, we lay the groundwork for making predictions and uncovering insights.