M2 · Data AnalysisM2-0223 min read

Lesson 14 of 51 · Module 3 of 7 · Week 2

Threads:The multimodal-measurement threadThe trust and safety thread

Exploratory Data Analysis: Descriptive Statistics, Correlation, and Why Pearson r Never Proves Causation

Exploratory data analysis (EDA) profiles a cleaned dataset with descriptive statistics (mean, median, variance, quantiles) and plots (histograms, box plots, scatter plots, line charts) before any model touches it, and its single most heavily tested fact is that Pearson correlation r measures linear association only, ranges from −1 to +1, and never establishes causation — a controlled or randomized experiment is required for that, and a strong r can just as easily reflect a confounding variable, reverse causation, or coincidence.

By the end you can

  1. 01Summarize a dataset with mean, median, variance, and quantiles, and know when the median is the safer choice
  2. 02Match a distribution, relationship, or trend question to the right EDA plot
  3. 03Compute and interpret Pearson r, including its −1 to +1 range and its restriction to linear association
  4. 04Name the three alternative explanations — confounder, reverse causation, coincidence — for a correlation that is not causal
01

What exploratory data analysis is

EDA is the practice of summarizing and visualizing a dataset — using descriptive statistics and plots — to understand its structure, distributions, and relationships before building or evaluating a model on it. [GROUND TRUTH] (Sources/nca-genm/domain-2-data-analysis.md): "EDA uses descriptive statistics (mean, median, variance, quantiles) and plots to understand data before modeling." The "before modeling" placement matters as much as the activity itself: EDA is diagnostic, not corrective. Cleaning fixes problems; EDA finds out what problems (and what genuine signal) are there to begin with, and a cleaning decision made without an EDA pass first — imputing a column's mean without ever having looked at whether that column is skewed, say — is exactly the kind of mistake M2-01 warned against.

Descriptive statistics reduce a column to a small set of numbers: the mean (arithmetic average), the median (middle value when sorted), variance (average squared distance from the mean, describing spread), and quantiles (values that divide the sorted data into equal-sized groups — the median is the 50th percentile, a specific quantile). Each statistic answers a different question about the same column, and none of them alone is a substitute for looking at the actual distribution, which is exactly what the plotting half of EDA supplies.

02

L1 — Intuition

Every EDA plot is ultimately answering one of three questions about the data: what does a single variable look like on its own (distribution), how do two variables move together (relationship), and how does a variable change as time passes (trend). Picking the right plot for the right question is covered in full in M2-03; this section covers what each plot type reveals about the statistics underneath it.

L2 — Mechanism

[GROUND TRUTH] (Sources/nca-genm/domain-2-data-analysis.md) groups the standard EDA visuals into exactly these three families: "Distributions: histograms, box plots, density plots. Relationships: scatter plots; correlation (Pearson r)... Trends: line charts over time; rolling averages." A histogram bins a single numeric column and shows how many observations fall into each bin, revealing shape (symmetric, skewed), modality (one peak, several peaks), and spread directly — information a mean and a standard deviation alone compress away. Two columns with identical means and standard deviations can have completely different shapes (one symmetric, one bimodal), and only the histogram shows the difference. A box plot summarizes the same distribution with five landmarks — minimum, 25th percentile, median, 75th percentile, maximum, plus flagged outliers beyond the IQR fences from M2-01 — trading some shape detail for a compact, side-by-side-comparable format, which is exactly why box plots are the tool of choice for comparing a distribution across several categories at once. A scatter plot places one variable on each axis and reveals whether two variables move together, whether that movement is linear or curved, and whether there are clusters or bivariate outliers a single-variable view would never expose. A line chart connects ordered observations — almost always over time — and reveals trend, seasonality, and sudden change points; a rolling average (the mean of the last N observations, recomputed as you slide forward through the series) smooths short-term noise so an underlying trend becomes visible.

L3 — The exam-relevant edge case

The trap worth naming explicitly: none of these plots, on their own, proves anything about why a pattern exists — they describe the data's shape, and shape is a separate question from mechanism. A histogram showing two peaks (bimodality) tells you the column likely contains two mixed populations; it does not tell you what those populations are or why they differ, which requires domain knowledge or further investigation, not a fancier chart. This distinction — descriptive versus explanatory — is the same one section 4 makes explicit for correlation specifically, and it is worth internalizing here first because it generalizes to every plot in this section.

03

Correlation: what Pearson r measures, and what it explicitly does not

L1 — Intuition

Once you suspect two variables are related from a scatter plot, correlation gives that impression a number. The number that shows up on this exam is Pearson's r, and the single fact worth memorizing cold is that it measures one specific kind of relationship — linear — and nothing else.

L2 — Mechanism

[GROUND TRUTH] (Sources/nca-genm/domain-2-data-analysis.md): "correlation (Pearson r) measures linear association only, ranging −1…+1." An r of +1 means the two variables move in perfect lockstep in the same direction — as one increases by some amount, the other increases by a proportional amount, every time, with zero scatter around that straight-line relationship. An r of −1 is the same perfect lockstep but in opposite directions. An r of 0 means no linear relationship — critically, not necessarily no relationship of any kind at all, which is the exact gap section 4 exploits. Values between those extremes describe how tightly the data clusters around the best-fit line: an r of 0.9 describes a strong, tight linear relationship with modest scatter; an r of 0.3 describes a real but noisy linear tendency, with a great deal of variation that the linear relationship does not explain.

The word "linear" is the entire mechanism, and it is worth being explicit about why: Pearson's r is computed from how consistently two variables move together in proportion, which is exactly what a straight line captures and exactly what a curve does not. Two variables can be perfectly related by a non-linear rule — y = x² is a textbook example, where y is entirely determined by x — and still produce a Pearson r near zero over a symmetric range of x, because the linear correlation coefficient has no vocabulary for capturing "increases, then decreases" as a single relationship. Where a correlation-based EDA pass ends and a scatter plot remains necessary is exactly this case: a scatter plot will show the curve visually even when the correlation coefficient reports no relationship at all.

L3 — The exam-relevant edge case: correlation is not causation

This is the domain's single most emphasized fact, stated in the source material without qualification. [GROUND TRUTH] (Sources/nca-genm/domain-2-data-analysis.md) — "Correlation ≠ causation. A relationship in the data does not prove one variable causes another — watch for confounders, reverse causation, and coincidence. Establishing causation generally requires a controlled/randomized experiment." Three named alternative explanations for an observed correlation, each of which produces the exact same r value a real causal relationship would:

A confounder is a third variable that independently influences both variables being correlated, creating an apparent relationship between them that has no direct link at all. Ice cream sales and drowning incidents correlate strongly across a year of data — not because ice cream causes drowning, but because both are driven by a third variable, hot weather, that increases both simultaneously.

Reverse causation means the causal arrow the data seems to suggest actually runs the opposite direction. A correlation between "hospital visits" and "reported symptom severity" might tempt you to conclude visits cause severity to be noticed and reported, when the more sensible direction is that severity drives the decision to visit a hospital in the first place — the correlation is real, the direction assumed from it can be exactly backwards.

Coincidence covers a correlation that is real in the specific dataset measured but does not reflect any stable underlying relationship at all — an artifact of a small sample, a short time window, or the sheer number of variable pairs tested (test enough pairs and some will correlate strongly by chance alone, with nothing behind it).

M3-01, in the next module, covers the actual tool that distinguishes a genuine causal claim from any of these three alternatives — the controlled or randomized experiment, where you manipulate one variable directly and hold everything else fixed, so that the confounder, reverse-causation, and coincidence explanations no longer have a lever to pull.

⭐ THE EARNED INSIGHT

A high Pearson r is evidence a relationship exists in your data; it is never, by itself, evidence about why. The "why" question needs either a controlled experiment or a causal argument grounded in domain knowledge that rules out confounders and reverse causation one at a time — correlation supplies the "what," never the "why."

04

Comparison: descriptive statistic, what it answers, and its blind spot

Statistic / plotQuestion it answersWhat it revealsIts blind spot
MeanWhat is the "typical" value?Central tendency, sensitive to every observation equallyDistorted by outliers and skew — see M2-01's median-imputation rule
MedianWhat is the middle value?Central tendency, robust to outliersIgnores magnitude of extreme values entirely
Variance / standard deviationHow spread out is the data?Dispersion around the meanSame units problem as the mean — inflated by outliers
HistogramWhat shape does one variable have?Skew, modality, spread, visuallySays nothing about a relationship to any other variable
Scatter plotDo two variables move together, and how?Linear or non-linear relationship, clusters, bivariate outliersShows association visually but proves nothing about cause
Pearson rHow strong and in what direction is the linear relationship?A single number summarizing scatter-plot tightnessBlind to non-linear relationships; never establishes causation
05

Worked example: computing descriptive statistics and Pearson r by hand

Treat the following as an illustrative construction built to make the arithmetic legible, not a measurement from any real dataset. Suppose a small sample of 6 training runs logs batch_size and the resulting training_time_minutes:

text
batch_size            = [16, 32, 32, 64, 64, 128]
training_time_minutes = [58, 42, 39, 25, 23, 15]

Descriptive statistics for training_time_minutes:

text
mean   = (58+42+39+25+23+15) / 6 = 202 / 6 = 33.67
sorted = [15, 23, 25, 39, 42, 58]
median = (25 + 39) / 2 = 32.00   (average of the two middle values, n=6 is even)

Now compute Pearson's r between batch_size (x) and training_time_minutes (y), using the standard formula r = Σ[(x-x̄)(y-ȳ)] / sqrt(Σ(x-x̄)² · Σ(y-ȳ)²):

text
x̄ = (16+32+32+64+64+128)/6 = 336/6 = 56.00
ȳ = 33.67  (from above)

x - x̄:   -40.00, -24.00, -24.00,  8.00,  8.00,  72.00
y - ȳ:    24.33,   8.33,   5.33, -8.67, -10.67, -18.67

(x-x̄)(y-ȳ):
  -40.00 × 24.33  = -973.20
  -24.00 ×  8.33  = -199.92
  -24.00 ×  5.33  = -127.92
    8.00 × -8.67  =  -69.36
    8.00 × -10.67 =  -85.36
   72.00 × -18.67 = -1344.24
  sum = -2799.99  (≈ -2800.00)

(x-x̄)²: 1600.00, 576.00, 576.00, 64.00, 64.00, 5184.00  -> sum = 8064.00
(y-ȳ)²:  592.11,  69.39,  28.41, 75.17, 113.85, 348.57  -> sum = 1227.50

r = -2800.00 / sqrt(8064.00 × 1227.50)
  = -2800.00 / sqrt(9,901,560)
  = -2800.00 / 3146.67
  = -0.890

Reading the result: r ≈ −0.89 is a strong negative linear correlation — as batch size increases, training time decreases, and the relationship is tight enough that most of the variation in training time tracks the variation in batch size. That is a real, useful descriptive fact for planning a training run's compute budget. What it is not is proof that increasing batch size mechanically causes faster training as a general law — in this constructed scenario the relationship is mechanistically plausible (larger batches mean fewer optimizer steps per epoch, which plausibly drives the time down directly), so causation is a reasonable inference here, but that inference comes from domain knowledge about how training loops work, not from the r value itself. A dataset showing the identical r = −0.89 between two variables with no such mechanistic story — say, "the day of the week a run started" and "training time" — would deserve exactly the same statistical respect and exactly the same causal skepticism.

06

Second worked example: a correlation that is really a confounder

Treat the following as a constructed scenario. A multimodal-data team observes that, across 200 image-captioning datasets they have used, datasets with longer average captions also show higher model accuracy after training on them, with a computed Pearson r = 0.81 between avg_caption_length and resulting_val_accuracy. A junior team member proposes writing longer captions for every future dataset to directly improve accuracy.

Before acting on that proposal, apply the three-alternative-explanation check from section 3's L3 tier:

text
Candidate explanation 1 -- direct causation:
  Would longer captions mechanistically supply more training signal per
  example? Plausible in principle (more words, more grounding detail per
  image) but not established by r = 0.81 alone.

Candidate explanation 2 -- confounder:
  Which datasets tend to have longer captions in this sample of 200?
  Inspection shows: datasets curated by professional annotation teams
  (rather than scraped/crowdsourced captions) have both longer AND
  more accurate captions -- annotation quality is a plausible confounder
  driving both variables at once.

Candidate explanation 3 -- reverse causation:
  Could higher accuracy somehow cause longer captions, rather than the
  other way round? Implausible here -- caption length is fixed at dataset
  creation time, before any model is trained on it, so the causal arrow
  cannot run this direction.

Candidate explanation 4 -- coincidence:
  With n=200 datasets and a real r=0.81, coincidence alone is an unlikely
  full explanation, though it cannot be ruled out from correlation data
  alone.

The confounder explanation — annotation quality driving both caption length and accuracy — is at least as well-supported by the same r = 0.81 as the direct-causation story the junior team member assumed, and it points to a completely different intervention: invest in annotation quality control, not simply "write longer captions." Distinguishing between these explanations from the correlational data alone is not possible; it requires either domain knowledge that rules some explanations out (as it did for reverse causation above) or a controlled experiment — take one dataset, hold annotation quality fixed, and vary only caption length to see whether accuracy actually moves. That experiment is exactly what M3-01's "one variable at a time" design principle exists to run.

07

EDA across modalities: what changes when the columns are not all numbers

L1 — Intuition

Everything in sections 1 through 6 was framed the way the source material frames it — around numeric columns in a table — because that framing is where descriptive statistics and Pearson r are cleanly defined. A multimodal dataset complicates the picture without changing the underlying discipline: every modality still has a distribution worth profiling, a relationship worth checking, and a trend worth watching, but the specific statistic or plot that applies shifts with the data type.

L2 — Mechanism

For an image column, "descriptive statistics" typically means profiling metadata rather than pixel values directly during an initial EDA pass: the distribution of image dimensions, aspect ratios, file sizes, and color-channel counts (grayscale versus RGB versus RGBA) across the dataset. A histogram of image widths reveals whether a dataset is dominated by one resolution or genuinely mixed, which matters directly for a later resizing or patch-embedding step — a dataset with a long tail of unusually small images is a candidate for either filtering or a resizing strategy that does not distort the small end. For a text column — captions, transcripts, OCR output — the same "distribution" question becomes a distribution of token or word counts per document rather than a numeric feature's magnitude, along with vocabulary size and duplication rate; a caption dataset where most captions run 8-12 words but a long tail runs past 200 words is signaling either genuinely richer descriptions or a data-quality problem (concatenated captions, boilerplate text) that a straight numeric-column EDA habit would never think to check for. For an audio column, duration and sample-rate distributions play the same diagnostic role a numeric histogram plays for a tabular feature.

Correlation between modalities is a real and useful EDA question, but it needs a matching representation before Pearson r can apply to it at all — you cannot compute a linear correlation between a raw image and a raw caption, because neither one is a single number. The practical move is to correlate a derived numeric summary of each modality: image brightness against caption sentiment, image complexity (edge density, as one proxy) against caption length, audio loudness against transcript word count. Every one of section 3's causal cautions still applies once you do this, with an extra layer of care: a correlation between two derived summaries is only as meaningful as the summary statistic chosen to represent the modality, and a poorly chosen summary (average pixel brightness as a stand-in for "image complexity," say) can manufacture or hide a relationship that a better-chosen summary would show differently.

L3 — The exam-relevant edge case

The source material's own framing keeps EDA's core mechanics — descriptive stats, distributions, relationships, trends — modality-agnostic by design, and the domain's consistency point from M2-01 resurfaces here in a specific form: an EDA pass across multiple modalities is also where a broken pairing gets caught before it becomes a training-time failure. If an image-caption dataset's caption-length histogram shows an unexpected cluster of zero-length or placeholder captions, that is an EDA finding, not a modeling finding — the fix belongs back in cleaning, not in a more sophisticated fusion architecture.

08

Why EDA and correlation are on the NCA-GENM exam

Data Analysis is Domain 2 at 10% exam weight, and EDA sits at its center as the step between cleaning and modeling [GROUND TRUTH] (Sources/nca-genm/domain-2-data-analysis.md). The domain's self-check questions make the tested shape explicit: one of the six official self-check items states directly, "Two variables have Pearson r = 0.9. What can you conclude?" with the keyed answer "They are strongly linearly correlated, but causation is not established," against distractors offering "one causes the other," "there is no relationship," and "the relationship is definitely nonlinear" [GROUND TRUTH] (Sources/nca-genm/domain-2-data-analysis.md). Each distractor names a real, different concept — causation, absence of any relationship, nonlinearity — that a correlation value alone cannot confirm or rule out, which is exactly the gap this lesson has walked through in sections 3 and 6.

A second recognizable shape presents a scenario (two metrics moving together over some period, a business result "explained" by a single correlated factor) and asks what conclusion is warranted. The keyed answer names the correct scope — a linear association exists, description not explanation — while distractors overreach into a causal claim the data cannot support on its own, or underreach into denying any relationship exists at all when the actual r value shows a clear if imperfect trend.

A third recognizable shape gives you two named quantities and a computed r, then asks which of the three named alternative explanations (confounder, reverse causation, coincidence) best fits an added detail in the stem — for instance, a stem that adds "both variables increased sharply during a single unusual month, and the pattern does not hold in any other month" is pointing at coincidence in a small, non-representative window, whereas a stem that adds "a third factor, seasonal demand, plausibly drives both" is pointing at a confounder. Recognizing which of the three fits requires reading the stem's added detail carefully rather than defaulting to the same explanation every time; the exam rotates among all three rather than always testing the confounder case, since that is the one most people remember at the expense of the other two.

What the distractors typically look like

The exam's reliable traps mirror the ones the source material calls out directly: treating a high r as proof of causation; treating a low or zero r as proof that no relationship of any kind exists, when it may only rule out a linear one; and skipping the confounder/reverse-causation/coincidence checklist in favor of accepting the first plausible causal story a correlation seems to support. A subtler distractor worth naming specifically: an answer choice that correctly says "correlation does not equal causation" but then incorrectly concludes "therefore no relationship exists at all" — the correct scope is narrower than that, and an r of 0.9 is still a strong, real, useful descriptive fact about the data even though it says nothing about mechanism.

09

Common mistakes about EDA and correlation

MistakeSymptom you would actually observeCauseFix
Treating a high Pearson r as proof of causationA team acts on a correlated variable and the intervention does not produce the expected effectCorrelation was mistaken for a demonstrated causal mechanismRequire a controlled/randomized experiment, or a strong independent mechanistic argument, before treating a correlation as causal
Treating r ≈ 0 as proof of "no relationship"A real non-linear relationship (e.g., a curve) goes unnoticed because r was lowPearson r only captures linear associationAlways pair a correlation coefficient with a scatter plot to check for non-linear structure
Using the mean to summarize a skewed distribution during EDAThe reported "typical value" does not match where most of the data actually sitsMean is pulled toward the skewed tail, same mechanism as M2-01's mean-imputation trapReport the median (and the full distribution via histogram) alongside or instead of the mean for skewed columns
Not checking for a confounder before acting on a correlationAn intervention targets the correlated variable directly and produces no effect on the outcomeA third variable was driving both the "cause" and the "effect" all alongAsk what else might independently influence both variables before proposing an intervention
Assuming a small sample's correlation generalizesA correlation found in a small subset disappears or reverses on a larger datasetCoincidence in a small sample, mistaken for a stable patternTreat correlations from small samples with proportionally more skepticism, and re-check on more data before acting
Confusing rolling-average smoothing with the underlying trend itselfA rolling average is read as "the data," and short-term real signal (a sudden spike) is dismissed as noiseA rolling average is a smoothing transformation, not a re-measurementAlways inspect the raw series alongside any rolling average, especially around apparent change points

What does a Pearson r of exactly 0 actually mean?

An r of 0 means there is no detectable linear trend between the two variables across the data measured — as one variable increases, the other shows no consistent tendency to increase or decrease in proportion. It does not mean the variables are unrelated in every sense; a strong non-linear relationship, like a U-shaped or inverted-U-shaped curve, can produce an r near 0 even though the two variables are, in fact, tightly and predictably linked. Whenever r comes back near 0 on a relationship you have reason to suspect exists, the correct next step is a scatter plot, not a conclusion that the variables are independent.

Can two variables be correlated without either one causing the other?

Yes, and this is the normal case rather than the exception whenever a shared underlying driver is at work. A confounding variable that independently influences both measured variables produces a real, reproducible correlation between them with no direct causal link at all — the classic example is a third variable, like season or weather, that drives both quantities being compared. Establishing that neither variable causes the other, or that a third variable is responsible for both, generally requires either controlling for the suspected confounder statistically or running an experiment that manipulates one variable while holding the suspected confounder fixed.

When is a correlation strong enough to act on without running a full experiment?

There is no fixed r threshold that makes an experiment unnecessary, and treating 0.7 or 0.8 as an automatic "acceptable to act on" line is itself a version of the causation trap. What actually justifies acting on a correlation without a dedicated experiment is a combination of a strong, consistent r across multiple independent samples, a plausible mechanistic story for why the relationship should be causal, and the explicit ruling-out of the obvious confounders and the reverse-causation direction for the specific variables involved. Even then, the honest framing is "acting on a well-supported hypothesis," not "acting on proven causation" — the distinction the exam's self-check question is built to test.

Why does the exam's self-check question use r = 0.9 specifically, rather than a lower value?

Choosing a high, unambiguous r value isolates the concept being tested. At r = 0.9, there is no room for a test-taker to hide behind "well, the relationship might not even be real" — the linear relationship is obviously strong and obviously real in the data. That forces the only defensible wrong move left, claiming causation, into the open, which is exactly the distractor the question is built to catch. A lower value, like r = 0.3, would let a test-taker equivocate about whether a real relationship exists at all, diluting the specific lesson about causation with a separate question about statistical significance and sample size that the domain's foundational-level scope does not require you to resolve.

Glossary recap: EDA and correlation terms this lesson introduced

TermOne-line definition
Exploratory data analysis (EDA)Summarizing and visualizing a dataset with descriptive statistics and plots to understand it before modeling
MeanThe arithmetic average of a column; sensitive to outliers and skew
MedianThe middle value of a sorted column; robust to outliers
VarianceThe average squared distance of values from the mean, describing spread
QuantileA value dividing sorted data into equal-sized groups; the median is the 50th percentile
HistogramA binned plot showing the shape, skew, and modality of one numeric variable
Box plotA five-number-summary plot (min, Q1, median, Q3, max, outliers) useful for comparing distributions across groups
Rolling averageThe mean of the last N observations, recomputed as you move through an ordered series, to smooth short-term noise
Pearson rA −1…+1 statistic measuring the strength and direction of a linear relationship between two variables
ConfounderA third variable that independently influences two correlated variables, creating an apparent relationship with no direct link
Reverse causationWhen the true causal direction runs opposite to the one a correlation superficially suggests
Controlled/randomized experimentManipulating one variable directly while holding others fixed — the standard route to a causal claim

Key takeaways on exploratory data analysis and correlation

  • EDA profiles a dataset with descriptive statistics (mean, median, variance, quantiles) and plots (histograms, box plots, scatter, line) before any model touches it — descriptive, not corrective.
  • The median is robust to skew and outliers; the mean is not — the same reasoning M2-01 applied to imputation applies to every summary statistic you report during EDA.
  • Pearson r measures linear association only, ranges −1 to +1, and never establishes causation on its own.
  • A high r can reflect direct causation, a confounder, reverse causation, or coincidence — correlational data alone cannot distinguish among these four.
  • Establishing causation generally requires a controlled or randomized experiment, which M3-01 covers as the discipline of changing one variable at a time.
  • Always pair a correlation coefficient with a scatter plot: r is blind to non-linear relationships that a plot will show directly.
  • Descriptive statistics and correlation describe what the data shows; they never by themselves answer why — mechanism requires either domain knowledge or an experiment.

You can now describe a dataset honestly and know exactly what a correlation does and does not license you to claim about it. The next question is how to show that description to someone else without the chart itself becoming the next source of a misleading claim. M2-03 covers exactly that: matching a chart type to the analytical question you are actually asking, and the specific ways a chart — truncated axes, the wrong chart type, unnecessary 3-D effects — can misrepresent honestly-computed statistics.