Chapter 10
Correlation and Regression
IN THIS CHAPTER
Exploring statistical relationships between numerical variables
Distinguishing between association, correlation, and causation
Making predictions based on known relationships
In this chapter, you analyze two numerical variables, X and Y, to look for patterns, find the correlation, and make predictions about Y from X, if appropriate, using simple linear regression.
Picturing the Relationship with a Scatterplot
A fair amount of research supports the claim that the frequency of cricket chirps is related to temperature. And this relationship is actually used at times to predict the temperature using the number of times the crickets chirp per 15 seconds. To illustrate, I’ve taken a subset of some of the data that’s been collected on this; you can see it in Table 10-1.
TABLE 10-1 Cricket Chirps and Temperature Data (Excerpt)
Number of Chirps (in 15 Seconds) |
Temperature (Fahrenheit) |
18 |
57 |
20 |
60 |
21 |
64 |
23 |
65 |
27 |
68 |
30 |
71 |
34 |
74 |
39 |
77 |
Notice that each observation is composed of two variables that are tied together, in this case the number of times the cricket chirped in 15 seconds (the X-variable), and the temperature ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access