Do Shady Leaves Weigh More? A Two-Sample t-Test

A reproducible write-up of the Activities 09–10 analysis

Author

Your Name Here

Published

September 10, 2026

Introduction

Leaves on the shady side of a tree may grow larger and heavier to capture more of the limited light beneath the canopy. We measured the mass (g) of leaves from the sunny and shady sides of a tree and tested whether mean leaf mass differs between sides.

  • Null hypothesis (H₀): \(\mu_{shady} = \mu_{sunny}\) — no difference in mean mass
  • Alternate hypothesis (Hₐ): \(\mu_{shady} \neq \mu_{sunny}\) — the means differ

We used a two-tailed test at \(\alpha = 0.05\).

Methods

We compared the two sides with a Welch’s two-sample t-test (var.equal = FALSE), which does not assume equal variances. Before testing we checked normality within each group with a Shapiro–Wilk test. All analysis was done in R with the tidyverse, and this report was produced in Quarto so that every value below is computed directly from the raw data.

Results

Table 1. Leaf mass (g) by shade (n, mean, SD, SE).
shade n mean_mass sd_mass se_mass
shady 28 0.523 0.148 0.028
sunny 25 0.505 0.210 0.042
Table 2. Welch’s two-sample t-test of leaf mass by shade.
Mean (shady) Mean (sunny) t df p-value
0.523 0.505 0.36 42.5 0.7237547

The group means, SD, SE, and n are in Table 1; the t, df, and p-value of the Welch’s test are in Table 2. The two means are very close, the 95% confidence interval for the difference includes zero, and the p-value is above the 0.05 threshold — so we do not find a significant difference in mean leaf mass between the sunny and shady sides.

Every number in Tables 1 and 2 is computed from the raw data when the document renders — nothing was typed or pasted. If a leaf measurement changed, you would fix the data file, press Render, and both tables would update themselves — and so would the sentence above, if you wrote it with inline code. In a plain script you would retype all of these by hand.

Boxplot comparing leaf mass in grams between the shady and sunny sides of the tree, with individual leaf masses overlaid as jittered points. The subtitle reports the Welch's t-test statistic and p-value.

Figure 1. Leaf mass by shade. Points show individual leaves; the test result is printed in the subtitle.

Conclusion

At \(\alpha = 0.05\) we fail to reject the null hypothesis: this sample does not show a difference in mean leaf mass between the sunny and shady sides of the tree. That is not proof that the sides are identical — only that any difference, if one exists, was too small to detect with this sample. The biological prediction that shade leaves grow heavier is not supported by these data. (Add a sentence of your own interpretation here — e.g. would a larger sample, or a different measure such as leaf area, tell a different story?)

References

  • Whitlock, M. & Schluter, D. The Analysis of Biological Data (2nd ed.).
  • Wickham, H. R for Data Science (2nd ed.)https://r4ds.hadley.nz/