Bad Analysis Museum: the segment that proved itself
The clusters differ in body mass with p far below 0.001. What does that test show?
Mystery 6~25 minapplied Palmer penguins
The story
Bad Analysis Museum, exhibit 7. The placard reads: "An analyst clustered 342 penguins into three segments using their bill, flipper and body-mass measurements, then ran an ANOVA of body mass across the segments. The F statistic was enormous and the p-value vanishingly small. The report concluded: the three segments are real, distinct groups, with a statistically significant difference in body mass."
Every step ran without error, and every number in the report is what the software printed. The museum keeps it because the conclusion does not follow. Your task is to rebuild the exhibit in CodeSplash, see for yourself why the test could not have come out any other way, and then do the honest version: check the clusters against something they were never shown.
Data: Palmer penguins · CC0-1.0. Horst AM, Hill AP, Gorman KB (2020). palmerpenguins. Data collected by Dr. Kristen Gorman and the Palmer Station LTER.
Cluster the penguins on their measurements with k-means and save the segments as a column, exactly as the analyst did. Species stays out: it is the outside evidence for later.
Which columns were the clusters built from?
Open Discover and choose Find segments.
Choose penguins (sample) as the data and read which features are suggested.
Press the k-means card.
Check that body_mass is among the features, keep k at 3, and press Run.
Press Save to dataset, then Save as new version. The segments become a column of penguins (sample).
Stage 2 · analyze · ~7 min
Run the exhibit's test
Now do what the placard says: an ANOVA of body mass across the three segments. Look at the size of F and ask what result would have been possible.
Could this test have come out non-significant, given how the segments were made?
Open One-way ANOVA in Analyze on penguins (sample).
Set Outcome to body_mass and Groups to the segment column you saved, then press Run.
Read F and the p-value. Then ask what k-means was trying to do when it drew the segments.A test on the same columns that built the groups measures the algorithm's success at separating them, not whether groups exist. That is double dipping.
Stage 3 · discover · ~7 min
The honest version
Evidence for real groups has to come from outside the clustering. Run k-means again with species as the label: species is never used to fit, so agreement with it is a genuine check.
How well do the segments agree with species, and is that evidence the exhibit lacked?
Back in Discover, open the k-means card on penguins (sample) again.
Set Label to species, keep the same features and k, and press Run.
Read the adjusted Rand index. What does it say that the ANOVA could not?Agreement with a label the clusters never saw is outside evidence. Differences on their own inputs are not.
Hints
Ask what k-means optimizes. It draws boundaries that make the groups differ on the features.
Body mass was a feature, so a test of body mass across the segments was settled before it ran.
Use species as the label. The adjusted Rand index is evidence the clusters correspond to something real.
explainer
A new placard for exhibit 7
Write the placard the museum should display: what the analyst did, why the ANOVA could not have failed, what double dipping is, and what the honest check showed.
What was done
Why the test could not fail
The name for it
The honest check
Rubric
Criterion
Points
Explains that k-means draws groups to differ on the features it was given.
2
States that testing a clustering feature across the clusters is circular.
2
Names the error (double dipping or circular analysis).
1
Reports the agreement with species and explains why it is valid evidence.
2
Generalizes the lesson to any selection followed by a test on the same data.
1
Model answer
Show the model answer
What was done. k-means grouped the penguins into three segments using bill length, bill depth, flipper length and body mass. An ANOVA then compared body mass across those segments and found an enormous F with a vanishingly small p-value.
Why it could not fail. k-means places its boundaries to make the groups as different as possible on its features. Body mass was one of them, so the segments differ in body mass by construction, whether or not the penguins fall into natural groups. The test measures how well the algorithm did its job.
The name. This is double dipping, or circular analysis: using the same data to choose groups (or features, or a hypothesis) and then to test them.
The honest check. Comparing the segments with species, a label the clustering never saw, gives an adjusted Rand index well above chance (read it from your run). That agreement is real evidence that the segments track something in the world, and it is evidence the ANOVA never provided. The same caution applies to any analysis that selects and then tests on the same rows.