Can nine tape-measure numbers find a species nobody had named yet?
2026-11-30
Note
✅ Today puts them together
adonis2())betadisper()We will cover: the animals, the 2002 species split, and where the seven sites are.
possum.csvImportant
✅ Today’s question
If we give PCA only the nine body measurements — no site, no state, no species — does it find the split on its own?
Lindenmayer et al. 1995 doi:10.1071/ZO9950449 · 2002 doi:10.1071/ZO01047
Note
🧠 Two things you have seen before
left_join() (Module 19) adds each site’s name, state, species and coordinates to every possum — no case_when() needed this timedrop_na(foot_l) drops the one possum with a missing foot. PCA cannot handle an NA# A tibble: 7 × 5
site site_name state species latitude
<dbl> <chr> <chr> <chr> <dbl>
1 1 Cambarville Vic cunninghami -37.6
2 2 Bellbird Vic cunninghami -37.6
3 3 Whian Whian NSW caninus -28.6
4 4 Byrangery NSW caninus -28.6
5 5 Conondale Qld caninus -26.4
6 6 Allyn River NSW caninus -32.1
7 7 Bulburin Qld caninus -24.6
species follows the 2002 splitleft_join() copies these columns onto all 103 possums
Warning
⚠️ Geography is not evidence of a species
We will cover: nine measurements, the correlation table, and prcomp().
| Column | What it is | Units |
|---|---|---|
head_l, skull_w |
head length, skull width | mm |
total_l, tail_l |
body length, tail length | cm |
foot_l, ear_l, eye |
foot, ear, eye | mm |
chest, belly |
girths | cm |
Important
✅ What is NOT in there
site, state or speciessex or ageSame rule as the Pokémon: build the axes from measurements, then colour by the group afterwards.
scale. = TRUE is a must head_l skull_w total_l tail_l foot_l ear_l eye chest belly
head_l 1.00 0.72 0.69 0.29 0.39 0.10 0.36 0.64 0.56
skull_w 0.72 1.00 0.53 0.26 0.28 0.00 0.32 0.63 0.45
total_l 0.69 0.53 1.00 0.57 0.44 0.14 0.26 0.58 0.52
tail_l 0.29 0.26 0.57 1.00 -0.13 -0.40 0.20 0.18 0.29
foot_l 0.39 0.28 0.44 -0.13 1.00 0.78 0.01 0.45 0.30
ear_l 0.10 0.00 0.14 -0.40 0.78 1.00 -0.15 0.20 0.05
eye 0.36 0.32 0.26 0.20 0.01 -0.15 1.00 0.15 0.24
chest 0.64 0.63 0.58 0.18 0.45 0.20 0.15 1.00 0.61
belly 0.56 0.45 0.52 0.29 0.30 0.05 0.24 0.61 1.00
head_l–skull_w 0.72, head_l–total_l 0.69foot_l–ear_l 0.78
ear_l–tail_l −0.40
Note
🧠 Prediction time
Importance of components:
PC1 PC2 PC3 PC4 PC5
Standard deviation 1.9859 1.4069 0.94399 0.85915 0.75083
Proportion of Variance 0.4382 0.2199 0.09901 0.08202 0.06264
Cumulative Proportion 0.4382 0.6581 0.75712 0.83913 0.90177
PC6 PC7 PC8 PC9
Standard deviation 0.55626 0.51648 0.40479 0.3795
Proportion of Variance 0.03438 0.02964 0.01821 0.0160
Cumulative Proportion 0.93615 0.96579 0.98400 1.0000
Note
🧠 Compare with the Pokémon
| PC1 | PC2 | Both | |
|---|---|---|---|
| Pokémon (6) | 44.1% | 18.4% | 62.5% |
| Possums (9) | 43.8% | 22.0% | 65.8% |
Nine columns, and more kept.
We will cover: the loadings, a sign surprise, and the plot that answers today’s question.
head_l −0.44, total_l −0.42, chest −0.41Warning
⚠️ The sign of a PC is arbitrary
prcomp() picks a direction at random-ish| Measurement | PC2 loading | |
|---|---|---|
ear_l |
+0.65 | ⬆️ |
foot_l |
+0.52 | ⬆️ |
chest |
+0.09 | |
head_l, total_l, belly |
≈ 0 | |
eye |
−0.26 | ⬇️ |
tail_l |
−0.46 | ⬇️ |
Important
✅ Mixed signs → a trade-off
speciesImportant
✅ The answer to today’s question
# A tibble: 2 × 5
species n mean_PC1 min_PC2 max_PC2
<chr> <int> <dbl> <dbl> <dbl>
1 caninus 58 0.262 -2.45 -0.118
2 cunninghami 45 -0.337 0.173 2.59
# A tibble: 2 × 5
species ear_l foot_l tail_l total_l
<chr> <dbl> <dbl> <dbl> <dbl>
1 caninus 44.9 65.4 37.9 86.8
2 cunninghami 52.5 72.4 35.9 87.6
Important
✅ Step 2 of the two-step: check the extremes against what you know
We will cover: hover to find the sites, and a biplot of all nine arrows.
Note
🧠 Size is a site thing, shape is a species thing
arrows_df <- as_tibble(possum_pca$rotation[, 1:2], rownames = "measure") %>%
mutate(PC1 = PC1 * 4,
PC2 = PC2 * 4)
ggplot(possum_scores, aes(x = PC1, y = PC2)) +
geom_point(aes(color = species), alpha = 0.5) +
geom_segment(data = arrows_df,
aes(x = 0, y = 0, xend = PC1, yend = PC2),
arrow = arrow(length = unit(0.2, "cm"))) +
geom_text_repel(data = arrows_df, aes(label = measure), size = 3.2)
ear_l and foot_l point up, towards the mountain brushtails
tail_l points down, towards the short-eared possumshead_l, skull_w, total_l, chest, belly point straight left
Important
✅ Same rules as the Pokémon
And report the shadow: PC1 + PC2 = 65.8%
We will cover: turning “it looks different” into a test.
Note
🧠 PERMANOVA
PERMutational Multivariate ANOVA
Tip
🎯 Why shuffle?
scale() — the same standardising scale. = TRUE did inside prcomp()
dist() — the straight-line distance between every pair of possums in 9-D
Warning
⚠️ Forget scale() and the test changes
Raw dist() lets the measurements with the biggest numbers (head length, ~90 mm) drown out the small ones (eye, ~15 mm).
adonis2()Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = possum_dist ~ species, data = possum_df, permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 184.22 0.20068 25.357 0.001 ***
Residual 101 733.78 0.79932
Total 102 918.00 1.00000
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Note
🧠 set.seed(42)
set.seed() makes your random shuffles the same as mine
Important
✅ Two true statements
A small R² does not mean a weak result. It means other things vary too.
betadisper() = the multivariate Levene’s testNote
🧠 Same logic as Module 24
| ANOVA | PERMANOVA |
|---|---|
leveneTest() |
betadisper() |
| equal variance | equal spread |
| want p > 0.05 | want p > 0.05 |
Permutation test for homogeneity of multivariate
dispersions
Permutation: free
Number of permutations: 999
Response: Distances
Df Sum Sq Mean Sq F N.Perm Pr(>F)
Groups 1 3.81 3.8098 3.3197 999 0.078 .
Residuals 101 115.91 1.1476
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Important
📝 The model paragraph
Nine body measurements from 103 brushtail possums at seven sites were standardised and reduced by principal component analysis. The first two components explained 65.8% of the variance (PC1 43.8%, PC2 22.0%). PC1 loaded in the same direction on all nine measurements and is interpreted as overall body size; it did not differ between species. PC2 contrasted ear length (+0.65) and foot length (+0.52) with tail length (−0.46), and separated Trichosurus cunninghami (Victoria) from T. caninus (NSW and Queensland) with no overlap: short-eared possums averaged 44.9 mm ears against 52.5 mm. A PERMANOVA on Euclidean distances of the standardised measurements confirmed that the species differ (F₁,₁₀₁ = 25.4, R² = 0.20, p = 0.001, 999 permutations); group dispersions did not differ significantly (betadisper, p = 0.078).
Warning
⚠️ Don’t over-claim
Not OK: “PCA proves these are two species.”
OK: “The two species differ consistently in body shape.”
Species are decided by genetics, breeding and shape together. We showed the shape part.
dist(scale(...)) → adonis2() → betadisper()Note
✅ Next
Open the activity and type it in — skeleton sections match the activity Parts. 🔴