Back to List

Two Variables Moving Together: Look at the Scatterplot Before the Correlation Coefficient

Explains why scatterplots should be examined before Pearson r when two variables move together, and how to distinguish nonlinearity, outliers, range restriction, clusters, and confounding.

Intermediate
|
27min
|
Verified (2026-08-14)
correlationcorrelation coefficientscatterplotlinearityconfoundingrange restrictionJMP
Progress0/19 (0%)

As metabolite concentration in culture medium increased, cell viability also increased. If the correlation coefficient between the two variables is r=.78, can we conclude that increasing the metabolite will improve viability? Correlation is a starting point, not a causal conclusion.

This unit has one question.


How much can we say from the fact that two variables move together?
์ƒ๊ด€๊ณ„์ˆ˜ r์„ ํ˜• ๋™ํ–‰์˜ ๋ฐฉํ–ฅ๊ณผ ํ‘œ์ค€ํ™”๋œ ํฌ๊ธฐ
์‚ฐ์ ๋„๋‘ ์—ฐ์†๋ณ€์ˆ˜์˜ ์‹ค์ œ ๋ชจ์–‘
๋ฒ”์œ„์ œํ•œ๊ด€์ธก X ๋ฒ”์œ„๊ฐ€ ์ข์•„ ๊ด€๊ณ„๊ฐ€ ์•ฝํ•ด ๋ณด์ด๋Š” ํ˜„์ƒ
๊ต๋ž€X์™€ Y ๋ชจ๋‘์— ์–ฝํ˜€ ๊ด€๊ณ„๋ฅผ ์™œ๊ณกํ•˜๋Š” ๋ณ€์ˆ˜

A correlation coefficient compresses linear co-movement into โˆ’1 to +1

Pearson's correlation coefficient r is a standardized summary of whether two variables tend to depart from their own means in the same direction.

  • r>0: observations with larger X also tend to have larger Y in a linear pattern
  • r < 0: observations with larger X tend to have smaller Y in a linear pattern
  • |r| close to 1: points lie close to a straight line
  • rโ‰ˆ0: linear co-movement is weak

r=0 does not mean that no relationship exists. In a perfect U-shaped relationship, the slopes on the two sides can cancel and leave r near zero. Draw a scatterplot before calculating one number.

U14 ยท Figure 01
๊ฐ™์€ r ํ•˜๋‚˜๋ณด๋‹ค ์‚ฐ์ ๋„์˜ ๋ชจ์–‘์ด ๋” ๋งŽ์€ ์ •๋ณด๋ฅผ ๊ฐ€์ง‘๋‹ˆ๋‹ค
๊ด€์ธก๊ฐ’๊ณผ ์ ํ•ฉ ์ง์„ ์ž”์ฐจ = y โˆ’ ลท
์ด์ƒ๊ฐ’ ํ•˜๋‚˜, ๊ด€์ธก ๋ฒ”์œ„์™€ ๊ณก๋ฅ ์€ r์„ ํฌ๊ฒŒ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ ์„ ๋จผ์ € ๋ณด๊ณ  ๊ณ„์ˆ˜๋ฅผ ์ฝ์Šต๋‹ˆ๋‹ค.

Correlation removes the units of X and Y, which makes comparisons easier, but it does not state an actual amount of change. โ€œHow much does Y change when X increases by one?โ€ is a question about a regression slope and is covered in the next unit.

The same r can conceal very different data

Check the following features in a scatterplot.

  1. Linearity: do points lie around a line, or are there curves, thresholds, or saturation?
  2. Outliers: do one or two points control the direction and size of the result?
  3. Range restriction: was only a narrow part of X observed?
  4. Clusters: are there groups by plate, donor, or date?
  5. Heteroscedasticity: does the spread of Y increase as X increases?
  6. Measurement error: does repeat precision in X and Y attenuate the relationship?

Restricting a sample to healthy adults can weaken an ageโ€“biomarker relationship that is strong in the full population. Conversely, combining two batch clusters can make overall r large even when no relationship exists within either cluster.

Check row independence again

If 20 cells from one donor are plotted as 20 independent points, cluster structure can make a p-value far too small. Donor-level summaries, repeated-measures correlation, or a hierarchical model are needed. The number of points is not the same as the amount of independent information.

Correlation has the same value when direction is reversed and does not assign a cause

cor(X,Y)=cor(Y,X). Correlation does not determine which variable is explanatory and which is the response. A high r has several possible explanations.

  • X affects Y.
  • Y affects X.
  • A third variable Z affects both.
  • Selection, measurement, or a time trend created an artificial relationship.
  • Chance and multiple exploration selected a large r.

Causal judgment requires temporal ordering, an intervenable design, randomization, control of confounding, mechanism, and replication. A small correlation p-value does not automatically satisfy those conditions.

p-values and CIs depend on n

A test of H0: population linear correlation ฯ=0 uses r and n. With a large n, even a small r can be significant; with a small n, the CI for a large r can be wide. Report r, its CI, the independent n, and the scatterplot together.

If thousands of correlations are tested in a matrix of genes and endpoints, many small p-values arise by chance. Restrict candidates before analysis, or plan multiplicity control such as FDR and independent validation.

In-Silico Lab: create the fragility of r yourself

  1. Change the slope to โˆ’2, 0, and +2 to see the direction of r.
  2. Increase curvature to create a situation where the relationship is strong but r is weak.
  3. Add one outlier and see how much r moves.
  4. Check whether the sample r changes under the same generating conditions with a new seed.
In-Silico Lab ยท U14

์‚ฐ์ ๋„๋ฅผ ๋ฐ”๊พธ๊ณ  r์˜ ์ทจ์•ฝ์„ฑ์„ ๋ณด์„ธ์š”

๊ธฐ์šธ๊ธฐยทnoiseยท๊ณก๋ฅ ยท์ด์ƒ๊ฐ’์„ ๋ฐ”๊พธ๋ฉฐ ๊ฐ™์€ ๊ณ„์ˆ˜ ๋’ค์— ๋‹ค๋ฅธ ๋ชจ์–‘์ด ์ˆจ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์ฒ˜์Œ์ด๋ผ๋ฉด: ๋ฌด์—‡์„ ๋ˆŒ๋Ÿฌ์•ผ ํ•˜๋‚˜์š”?
  1. 1. ์งˆ๋ฌธ์„ ๋จผ์ € ์ฝ๊ธฐLab ์ œ๋ชฉ์—์„œ ์ด๋ฒˆ์— ๋น„๊ตํ•  ํ•œ ๊ฐ€์ง€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  2. 2. ์กฐ๊ฑด ํ•˜๋‚˜๋งŒ ๋ฐ”๊พธ๊ธฐ์ฒ˜์Œ์—๋Š” n, ํšจ๊ณผ, ์‚ฐํฌ ๊ฐ™์€ ์ž…๋ ฅ ์ค‘ ํ•˜๋‚˜๋งŒ ๋ฐ”๊พธ์‹ญ์‹œ์˜ค.
  3. 3. ์ƒˆ ํ•ฉ์„ฑ ํ‘œ๋ณธ ๋ˆ„๋ฅด๊ธฐ์ƒˆ ํ•ฉ์„ฑ ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŒ๋“ค์–ด์ง‘๋‹ˆ๋‹ค. ๊ฐ™์€ ์กฐ๊ฑด๋„ ํ‘œ๋ณธ์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  4. 4. ๊ทธ๋ฆผ๊ณผ ๊ณ„์‚ฐ ๊ฒฐ๊ณผ ๋น„๊ตํ•˜๊ธฐ๋ฐ”๊พธ๊ธฐ ์ „ํ›„ ๋ฌด์—‡์ด ์›€์ง์ด๊ณ  ๋ฌด์—‡์ด ๊ทธ๋Œ€๋กœ์ธ์ง€ ํ•œ ๋ฌธ์žฅ์œผ๋กœ ์ ์–ด๋ณด์‹ญ์‹œ์˜ค.

๋ง‰ํžˆ๋ฉด ์ดˆ๊ธฐํ™”๋กœ ๋Œ์•„๊ฐ€ ๊ธฐ๋ณธ ๊ฒฐ๊ณผ๋ฅผ ๋ณธ ๋’ค ์กฐ๊ฑด ํ•˜๋‚˜๋งŒ ๋ฐ”๊พธ์‹ญ์‹œ์˜ค. ์ด Lab์€ ์ •๋‹ต ํŒ์ •๊ธฐ๊ฐ€ ์•„๋‹ˆ๋ผ ํŒจํ„ด ๊ด€์ฐฐ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.

๊ฐ™์€ ์„ค์ •์˜ ํ•ฉ์„ฑ ๊ด€์ธก

๊ณ„์‚ฐ ๊ฒฐ๊ณผ

์ƒ๊ด€ r0.941
๊ธฐ์šธ๊ธฐ1.726
Rยฒ0.886
SSE30.40

r์€ ์„ ํ˜• ๋ชจ์–‘์˜ ์š”์•ฝ์ž…๋‹ˆ๋‹ค. ์ธ๊ณผยท์žฌํ˜„์„ฑยท๊ตฐ์ง‘ ๋…๋ฆฝ์„ฑ์€ ๋ณ„๋„ ์งˆ๋ฌธ์ž…๋‹ˆ๋‹ค.

๊ต์œก์šฉ synthetic model ยท bjs-relationship-sequence-v1. ์‹ค์ œ ์—ฐ๊ตฌ ํŒ๋‹จ์—๋Š” ์‹คํ—˜๋‹จ์œ„, ๊ฒฐ์ธก, ๋ถ„ํฌ, ๋‹ค์ค‘์„ฑ, ์‚ฌ์ „๊ณ„ํš๊ณผ ๋„๋ฉ”์ธ ๊ธฐ์ค€์„ ๋ณ„๋„๋กœ ๋ฐ˜์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

The line in the Lab is a simple regression line used to support explanation. Seeing a line does not establish causation or justify extrapolation.

In JMP, inspect each scatterplot before the matrix

Scatterplot Matrix

์ƒ๊ด€๊ณ„์ˆ˜๋ณด๋‹ค ๋จผ์ € ๋ชจ์–‘ยท๋ฒ”์œ„ยท๊ตฐ์ง‘ยท์ด์ƒ๊ฐ’์„ ๋ด…๋‹ˆ๋‹ค.

Correlation Matrix

r์˜ ๋ถ€ํ˜ธ์™€ ํฌ๊ธฐ, n๊ณผ p๊ฐ’์„ ํ•จ๊ป˜ ์ฝ์Šต๋‹ˆ๋‹ค.

Density Ellipse

ํƒ€์›์€ ์„ ํ˜• ๊ด€๊ณ„ ํ‘œํ˜„์ด๋ฉฐ ์ธ๊ณผ ๊ตฌ์กฐ๋ฅผ ๋ณด์ฆํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

A Correlation Matrix compresses many pairs but hides nonlinearity and outliers. Inspect the shape of every pair in a Scatterplot Matrix, and read a density ellipse as an auxiliary summary of a linear-normal structure. The slope of an ellipse does not indicate causal direction.

Example result statement

Across 42 independent batches, the Pearson correlation between metabolite X and viability was .61 (95% CI .38โ€“.77). The scatterplot showed a positive linear trend, but two high-concentration points were influential, and coloring by batch date suggested that clustering explained part of the pattern. This observational correlation was not interpreted as a causal effect of increasing X.

At the end of this unit

  • r gives the direction and standardized size of linear co-movement.
  • A nonlinear relationship can exist even when rโ‰ˆ0.
  • Outliers, range restriction, clusters, and confounding can change r substantially.
  • Correlation does not establish a causal direction between X and Y.
  • Consider r, its CI, independent n, and the scatterplot together rather than a p-value alone.
  • Large-scale correlation searches require multiplicity control and validation.
์ƒ๊ด€๊ณ„์ˆ˜ ํ•˜๋‚˜๋Š” ์‚ฐ์ ๋„์˜ ๋ชจ์–‘์„ ์••์ถ•ํ•  ๋ฟ์ž…๋‹ˆ๋‹ค. ๋น„์„ ํ˜•ยท์ด์ƒ๊ฐ’ยท๋ฒ”์œ„ยท๊ตฐ์ง‘ยท๊ต๋ž€์„ ๋ณด๊ณ ๋„ ๋‚จ๋Š” ์„ ํ˜• ๋™ํ–‰๋งŒ r๋กœ ์š”์•ฝํ•˜์‹ญ์‹œ์˜ค.

In the next unit, we express a relationship as Y=ฮฒโ‚€+ฮฒโ‚X+ฮต and use residuals to find what the straight line missed.

Official supplementary resources

The examples and Lab in this article use synthetic educational data.

๐Ÿ’ฌ Questions & Comments

0 comments

You can post without signing in. Guest comments cannot be edited or deleted by their author.

0/2000

Loading...