Two-way ANOVA + Tukey letters
MinutePlot® and R on the same data. MinutePlot version 1.0.0; R 4.5.2.
Dataset
- npk — Yield of peas in a 2×2×2 factorial experiment on 6 blocks (R: datasets::npk; Yates 1935); factors N and P used here.
- Data format for MinutePlot: npk_minuteplot.csv — arranged exactly as the app’s data template for this test expects (paste it into the app).
- Data format for R: npk_r.csv — the long-format file the R script reads (keep it in the script’s folder).
- R built-in: the script loads npk with data() (blocks and K pooled on the MinutePlot side).
Setup
In MinutePlot:
- Workbench → Two-way ANOVA → paste npk_minuteplot.csv (N down the rows, P as column blocks, six replicates per cell; blocks and K pooled).
- Post-hoc test: Tukey HSD (the default) · significance level α = 0.05 (the default) → Confirm and Analyze.
- Read the ANOVA table and the cell means with letters from the results; the page compares the all-cells letter set.
In R:
- Install once:
install.packages(c("emmeans", "multcomp", "multcompView")); then runnpk.Rtop to bottom (source it, or paste it into the console) with the R data file in the same folder. - R 4.5.2 and the package versions in the page header; each script prints the versions it runs under.
The analysis:
- Two-way ANOVA of yield by N (0/1) and P (0/1) with interaction, n = 6 per cell, α = 0.05.
- Pairwise comparisons of the cell means: Tukey HSD; compact letters from the significant pairs.
- Blocks are omitted to match MinutePlot’s fully crossed design; this entry is a software comparison, not a recommended analysis of npk.
Side-by-side results
ANOVA summary
MinutePlot®
| Term | df | F | p |
|---|---|---|---|
| N | 1, 20 | 5.7585 | 0.0263 |
| P | 1, 20 | 0.2556 | 0.6187 |
| N × P | 1, 20 | 0.6474 | 0.4305 |
R
| Term | df | F | p |
|---|---|---|---|
| N | 1, 20 | 5.7585 | 0.0263 |
| P | 1, 20 | 0.2556 | 0.6187 |
| N × P | 1, 20 | 0.6474 | 0.4305 |
R values: verified in R 4.5.2 (see the verdict).
Cell means with significance letters
MinutePlot®
| N | P | Mean | Letters |
|---|---|---|---|
| N0 | P1 | 52.417 | a |
| N0 | P0 | 51.717 | a |
| N1 | P1 | 56.150 | a |
| N1 | P0 | 59.217 | a |
R
| N | P | Mean | Letters |
|---|---|---|---|
| N0 | P1 | 52.417 | a |
| N0 | P0 | 51.717 | a |
| N1 | P1 | 56.150 | a |
| N1 | P0 | 59.217 | a |
R values: verified in R 4.5.2 (see the verdict).
In the app each cell carries a compound label such as Aa (Aa1 with three factors): uppercase compares the first factor within each level of the second, lowercase the reverse (the digit the third factor). The plain letters shown here are MinutePlot’s single letter set over all cells, the direct counterpart of R’s cld(). MinutePlot assigns “a” to the highest mean, R to the lowest — a display convention, not a discrepancy; the grouping (which cells share a letter) is what is compared.
Verdict
R script
npk.R — each script loads its data, prints its versions and the R-side tables shown above, in page order; no plotting.