A line through biological measurements

Day 20 — Association, residuals and limits

Data Analysis in Life Sciences

About this lecture

Plant ecologists often need the dry mass of leaves, but drying and weighing destroys the leaf. Leaf area is easy to measure from a photo or scan. If area and mass go together, a line can describe how. We collected one leaf from each of 18 plants and measured both. Do larger leaves have more dry mass, and how much more per cm²?

Today you will:

  • plot two measured variables and fit a line with the familiar lm();
  • state the slope with units: “about 4.11 mg per cm²”;
  • use residuals and a sensitivity check without deleting data;
  • keep apart association and cause, and stay inside the observed range.

Day 19 used a line as a measuring tool for prepared standards. Today the same code describes a biological pattern, and the interpretation changes. Week 5 turns to the computer itself.

Not a calibration: nobody set the leaf area

  • Day 19: we prepared the concentrations; only absorbance was measured.
  • Today: both area and dry mass were measured on leaves as they were found. Nothing was assigned.
  • Plant age, light, water or species could affect both measurements.
  • So the line can describe how they go together, not show that changing one changes the other.
  • One leaf per plant: 18 independent plants.

Three leaves of different sizes, each from a different plant; area and dry mass are measured and no treatment is assigned.

Plot first

  • x: leaf area (cm²); y: dry mass (mg). Mass is the variable we want to explain.
  • Larger leaves tend to be heavier: a clear positive association.
  • But the points scatter around the line: leaves of similar area differ in mass.
  • Observed areas: 2.96 to 14.68 cm².

Leaf dry mass rises with leaf area across 18 plants, with scatter around a fitted straight line.

Fit the line in R

> library(readr)
> leaves <- read_csv("data/leaf-mass.csv", show_col_types = FALSE)
> leaf_fit <- lm(dry_mass_mg ~ leaf_area_cm2, data = leaves)
> coef(leaf_fit)
  (Intercept) leaf_area_cm2 
     9.476606      4.110117 
  • Same lm() as Day 19: response (mass) on the left of ~, area on the right.
  • Line: fitted mass ≈ 9.48 + 4.11 × area.
  • The intercept, 9.48 mg, is the fitted mass at zero area, far outside the data. It positions the line; it is not a leaf.

The slope has units

  • Slope 4.11 mg per cm²: in these plants, a leaf with 1 cm² more area had on average about 4.11 mg more fitted dry mass.
  • Not 4.11 %, not 4.11 cm², and not a promise for every leaf.
  • Units change the number, not the biology: with area in mm² the slope is 0.0411 mg per mm², and every fitted mass is the same.

Along the fitted line, a step of one square centimetre in area corresponds to about 4.11 milligrams of fitted dry mass.

Residuals: what the line leaves out

  • Residual = observed − fitted mass, in mg.
  • A17 lies 8.4 mg below the line; A14 lies 6.3 mg above it.
  • Points on both sides of zero, no clear curve: a straight line is a reasonable summary here.
  • The plot cannot show independence. That comes from how the plants were sampled.

Residuals of the 18 leaves scatter on both sides of zero, mostly within about 5 milligrams, without a curved pattern.

Predictions: inside the observed range only

  • At 8 cm²: 9.48 + 4.11 × 8 ≈ 42.36 mg, a fitted mean. Single leaves of that size scatter around it.
  • At 25 cm² the formula gives 112 mg, and at 80 cm² 338 mg. No leaf that large was measured.
  • The relation may bend or change beyond the data. A longer line is not more evidence.

The fitted line covers observed areas up to about 15 square centimetres; a dashed extension into a shaded region without observations is unsupported.

Pitfall: one point can move the line

  • A18 is the largest leaf and sits at the end of the range, where a point has most influence.
  • Refit without A18, in a separate object: slope 4.065 instead of 4.110 mg per cm². A small change.
  • A18 has no recorded error, so it stays in the main result.
  • A sensitivity check asks “does my conclusion depend on one point?”. It is not a way to pick the line you like.

The fitted line for all 18 plants and a labelled sensitivity line without A18 almost coincide.

Write what the data support

“Across 18 plants, leaves with larger area had greater dry mass: within the observed range (2.96 to 14.68 cm²), each additional 1 cm² was associated with about 4.11 mg more fitted dry mass. The study was observational, so this does not show that increasing leaf area would increase mass.”

Claim Supported?
“Larger leaves tended to have more dry mass in this sample.” Yes, a description of the association.
“Adding 1 cm² of area causes 4.11 mg extra mass.” No: nothing was manipulated; other factors vary too.
“Every 8 cm² leaf weighs 42.36 mg.” No: that is a fitted mean; leaves scatter by several mg.
“A 30 cm² leaf will weigh about 133 mg.” No: far outside the observed areas.

Week 4: the question chooses the method

Design Day Output
Two independent groups 16–17 Mean difference, Welch CI
Same unit measured twice 18 Mean within-unit change, paired CI
Prepared standards → reading 19 Calibration line, inverse estimate
Two measured variables 20 Slope with units, residuals

Name the unit, the outcome and its units before choosing a function.

Three sketches: two independent groups lead to a mean difference, paired measurements to a within-unit change, and a scatter of two measurements to a slope and residuals.

Summary

Concept Key fact
Observational data Both variables measured, nothing assigned: the line describes, it does not show cause
Fit lm(dry_mass_mg ~ leaf_area_cm2, data = leaves): mass ≈ 9.48 + 4.11 × area
Slope 4.11 mg per cm² of fitted mean mass; 0.0411 mg per mm² is the same line
Intercept Fitted mass at area 0, outside the data; not a measured leaf
Residual Observed − fitted mass (mg); look for curvature or a point far away
Prediction Fitted mean, only within 2.96–14.68 cm² (8 cm² → 42.36 mg)
Sensitivity Without A18: slope 4.065; keep A18 in the main result
Choosing a method Design and question first: groups, pairs, calibration or association

Next (Day 21, how a computer works and how big data are): from the analysis to the machine that stores and processes the data.

Now: open the Day 20 exercises. Make association-report.Rmd with the plot and line, the slope in a sentence with units, the residual plot and a labelled A18 check; save output/day20-leaf-line.png and render.