Correlation vs Causation | data mining!

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

24 Terms

1
New cards

What does the correlation coefficient r measure?

The strength and direction of a linear relationship between two numeric variables, from −1 to 1.

2
New cards

What does the sign of r tell you?

The direction: positive means both rise together; negative means one rises as the other falls.

3
New cards

Which is stronger: r = −0.9 or r = 0.5?

r = −0.9. Strength is the size of r; the sign only shows direction.

4
New cards

Does r = 0 mean two variables are unrelated?

No. It only means there's no linear relationship; a strong curved relationship can still have r = 0.

5
New cards

Application: x = −2, −1, 0, 1, 2 and y = x². What is r?

0, even though y is completely determined by x. The two halves of the U shape cancel out.

6
New cards

Why is "r measures how correlated two variables are" a weak definition?

It's circular. Say instead: r measures the strength and direction of a linear relationship.

7
New cards

What is the formula for r?

r = Σ(dx · dy) / √(Σdx² · Σdy²), where dx and dy are each value minus its variable's mean.

8
New cards

What's the first step when computing r by hand?

Center both variables by subtracting each variable's mean. Never multiply the raw values.

9
New cards

After computing Σ(dx · dy), what's the last step for r?

Divide by √(Σdx² · Σdy²). Don't take a cosine of anything.

10
New cards

Application: x = 1, 2, 3, 4, 5 and y = 2, 1, 4, 3, 5. Find r.

dx = −2, −1, 0, 1, 2 and dy = −1, −2, 1, 0, 2. Σ(dx · dy) = 8, Σdx² = 10, Σdy² = 10, so r = 8 / 10 = 0.8.

11
New cards

What is a confounder?

A third variable that causes both A and B, creating a correlation between them even though A doesn't cause B.

12
New cards

Application: ice cream sales and drownings rise together. What explains it?

A confounder: summer weather drives both.

13
New cards

Are ice cream sales and drownings independent?

No. They are correlated; they just don't cause each other. Independent means no statistical relationship at all.

14
New cards

What is reverse causation?

When B actually causes A, rather than A causing B.

15
New cards

Application: towns with more firefighters at a fire see more damage. Why?

Reverse causation: bigger fires bring more firefighters.

16
New cards

Why is coincidence a real risk in data mining?

Testing thousands of variable pairs guarantees that some will correlate by pure chance.

17
New cards

How do you establish causation?

With a randomized experiment. Random assignment breaks the link to any confounders.

18
New cards

Application: more hours_per_week goes with earning >50K. What's a confounder?

Occupation or seniority: some jobs require more hours and also pay more.

19
New cards

Application: more hours_per_week goes with earning >50K. What's a reverse causation explanation?

Earning more brings more responsibility, which means working longer hours.

20
New cards

Why is relationship = "Husband" fine for predicting income but useless for advice?

Prediction only needs a reliable correlation; advice needs causation. Marriage doesn't cause higher income.

21
New cards

Application: married people tend to earn more. What's a reverse causation explanation?

A higher income makes someone a stronger dating candidate, so income leads to marriage, not the other way around.

22
New cards

Why look at the scatterplot before trusting r?

One point can create a strong r by itself (Anscombe Dataset IV), and r misses curves entirely.

23
New cards

How do you get a correlation matrix in pandas?

df[["col1", "col2", "col3"]].corr()

24
New cards
After centering a list (subtracting its mean), what is the new mean?
Always 0. The original mean stays what it was (e.g. 3 for 1, 2, 3, 4, 5); only the centered list averages to 0.