Math Atlas

산점도와 상관Scatter Plots & Correlation

Algebra 1Algebra 1 · 9. 자료 분석 기초9. Data Analysis Basics

학습 목표
  • 두 변수 자료를 산점도로 그리고, 상관의 방향과 강도를 읽는다.
  • 추세선을 일차함수로 세워 예측한다 — 그리고 외삽의 위험을 안다.
  • "상관은 인과가 아니다"를 예와 함께 설명할 수 있다.

점으로 흩뿌린 자료

지금까지의 함수는 규칙이 먼저 있고 그래프가 따라왔다. 실제 세상의 자료는 반대다 — 학생 아홉 명의 하루 공부 시간(xx)과 시험 점수(yy)를 조사해 순서쌍으로 찍으면:

x y O 2 4 6 8 10 20 40 60 80 100 y = 6x + 40
공부 시간과 점수의 산점도 — 점들이 오른쪽 위로 향하는 띠를 이루고, 그 사이로 추세선이 지나간다

이렇게 두 변수 자료를 좌표평면에 점으로 나타낸 그림이 산점도다. 점들은 한 직선 위에 얌전히 놓이지 않는다 — 하지만 오른쪽 위로 향하는 띠를 이룬다. 공부를 많이 한 학생이 대체로 점수도 높다.

정의상관

한 변수가 커질 때 다른 변수가 대체로 함께 커지면 양의 상관, 대체로 작아지면 음의 상관, 뚜렷한 경향이 없으면 상관이 없다고 한다. 점들이 직선 가까이에 몰릴수록 상관이 강하다고 한다.

음의 상관의 예 — 기온과 핫초코 판매량:

x y O 5 10 15 20 25 20 40 60 80 y = −3x + 80
기온과 핫초코 판매량의 산점도 — 점들이 오른쪽 아래로 향한다

키와 수학 점수처럼 아무 경향이 없는 쌍도 물론 있다. (상관의 강도를 1-111 사이의 수 하나로 재는 상관계수는 AP Statistics에서 만난다 — 지금은 눈으로 "강하다/약하다"를 판단한다.)

추세선 — 흩어진 점 사이로 직선을 긋는다

점들이 띠를 이루면, 그 띠의 한가운데로 직선을 그어 자료 전체를 하나의 일차함수로 요약할 수 있다. 이 직선이 추세선이다. 위 산점도의 추세선은

y=6x+40y = 6x + 40

— 그리고 이 식을 읽는 법은 일차함수 단원 그대로다. 기울기 66: 공부 11시간이 늘 때마다 점수가 평균적으로 66점씩 높아지는 경향. 절편 4040: 공부를 전혀 안 했을 때의 예상 점수.

추세선의 힘은 예측이다. 6.56.5시간 공부한 학생의 점수는?

y=6×6.5+40=79점(쯤).y = 6 \times 6.5 + 40 = 79 \text{점(쯤)}.

"쯤"이 중요하다 — 추세선은 경향의 요약이지 법칙이 아니라서, 실제 점은 선 위아래로 흩어진다. 예측은 언제나 근사다.

주의

관측 범위 밖으로 밀고 나가는 예측(외삽)은 위험하다. 위 모델에 x=20x = 20시간을 넣으면 160160점 — 100100점 만점 시험에서 불가능한 값이다. 자료는 191{\sim}9시간 범위에서 왔고, 추세선은 그 범위 안에서만 신용이 있다. 범위 밖에서는 경향 자체가 꺾일 수 있다(잠을 못 자면 점수는 오히려 떨어진다).

상관은 인과가 아니다

여름철 자료를 모으면 아이스크림 판매량물놀이 사고 건수 사이에 뚜렷한 양의 상관이 나온다. 그렇다고 아이스크림이 사고를 일으키는가? 물론 아니다 — 더운 날씨라는 공통 원인이 두 변수를 동시에 밀어 올릴 뿐이다.

산점도가 보여주는 것은 "함께 움직인다"까지다. 함께 움직이는지 — 한쪽이 원인인지, 제3의 공통 원인이 있는지, 우연인지 — 는 그림 밖의 문제다. 상관을 인과로 바꿔 읽는 순간 통계는 오독이 된다. 이 한 문장은 자료를 다루는 한 평생 유효하다.

세운 모델을 의심하기

추세선을 세웠으면 두 가지를 되물어야 한다. 첫째, 이상값 — 띠에서 뚝 떨어진 점이 있는가? 입력 실수일 수도, 특별한 사연이 있는 자료일 수도 있다(문제 탭에서 찾아 본다). 둘째, 직선이 맞는 모양인가 — 점들이 포물선처럼 휘어 있다면 일차 모델이 아니라 이차 모델이 맞는 옷이다(공중에 던진 공의 시간-높이 자료가 그렇다).

문제 탭에는 방향 판별과 그림 읽기부터 두 점으로 추세선 세우기, 기울기 해석, 외삽 비판, 상관≠인과 서술, 그리고 "전원이 22시간씩 더 공부하면 평균은?"을 묻는 경시 문제까지 열두 문제가 있다.

Goals
  • Plot two-variable data as a scatter plot and read the direction and strength of the correlation.
  • Build a trend line as a linear function and use it to predict — knowing the danger of extrapolation.
  • Explain, with an example, why "correlation is not causation."

Data scattered as points

Until now, the rule came first and the graph followed. Real-world data works backwards. Survey nine students' daily study hours (xx) and test scores (yy), and plot the pairs:

x y O 2 4 6 8 10 20 40 60 80 100 y = 6x + 40
A scatter plot of study time and scores — the points form a band heading up and to the right, with a trend line through it

A picture like this — two-variable data as points in the plane — is a scatter plot. The points refuse to sit neatly on one line, but they do form a band heading up and to the right: students who study more tend to score higher.

DefinitionCorrelation

When one variable grows and the other tends to grow with it, the correlation is positive; when the other tends to shrink, negative; with no visible tendency, there is no correlation. The tighter the points hug a line, the stronger the correlation.

A negative example — temperature versus hot-chocolate sales:

x y O 5 10 15 20 25 20 40 60 80 y = −3x + 80
A scatter plot of temperature and hot chocolate sales — the points head down and to the right

Pairs with no tendency at all exist too, of course — height and math scores, say. (The correlation coefficient, which packs the strength into one number between 1-1 and 11, waits in AP Statistics — for now the eye judges "strong" or "weak.")

The trend line: a line drawn through the scatter

When the points form a band, a line drawn down its middle summarizes the whole dataset as one linear function. That line is the trend line. For the scatter above it is

y=6x+40y = 6x + 40

— and you read it exactly as in the linear-functions unit. Slope 66: each extra hour of study comes, on average, with about 66 more points. Intercept 4040: the expected score with no studying at all.

The trend line's power is prediction. A student who studies 6.56.5 hours?

y=6×6.5+40=79 points — or thereabouts.y = 6 \times 6.5 + 40 = 79 \text{ points — or thereabouts.}

"Thereabouts" matters. A trend line summarizes a tendency; it is not a law, and actual points scatter above and below it. Every prediction is an approximation.

Watch out

Predicting beyond the observed range (extrapolation) is dangerous. Feed x=20x = 20 hours into the model and out comes 160160 points — impossible on a 100100-point test. The data came from the 1199 hour range, and the trend line's credit extends no further. Outside it, the tendency itself may bend (lose enough sleep and scores fall).

Correlation is not causation

Collect summer data and you will find a clear positive correlation between ice cream sales and swimming accidents. Does ice cream cause accidents? Of course not — hot weather, a common cause, pushes both variables up at once.

A scatter plot shows only that two things move together. Why they move together — one causing the other, a third common cause, or plain coincidence — lies outside the picture. The moment correlation gets read as causation, statistics becomes misreading. That one sentence stays valid for a lifetime of working with data.

Doubting the model you built

Once a trend line stands, two questions must follow. First, outliers — is any point far off the band? It might be a recording error, or a data point with a story (the problems tab has one to find). Second, is a line even the right shape? If the points bend like a parabola, the right garment is a quadratic model, not a linear one — time-versus-height data for a thrown ball does exactly that.

The problems tab runs from direction-reading and plot-reading through building trend lines from two points, interpreting slope, critiquing an extrapolation, writing out correlation-versus-causation, and a contest question — "if everyone studies 22 more hours, what happens to the average?" — twelve problems.