Three-way ANOVA — unbalanced (unequal cell sizes)

MinutePlot® and R on the same data. MinutePlot version 1.0.0; R 4.5.2.

Dataset

  • npk with rows removed — npk (R: datasets::npk) with four rows removed by a fixed rule -- rows 1, 6, 15 and 24 of the hosted npk.csv, one from each of four different cells -- leaving 20 observations: four cells of 2 and four of 3.
  • Data format for MinutePlot: npk_unbalanced_minuteplot.csv — arranged exactly as the app’s data template for this test expects (paste it into the app).
  • Data format for R: npk_unbalanced_r.csv — the long-format file the R script reads (keep it in the script’s folder).

Setup

In MinutePlot:

  • Workbench → Three-way ANOVA → paste npk_unbalanced_minuteplot.csv (same layout; the removed replicates are empty cells).
  • 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("car", "emmeans", "multcomp", "multcompView")); then run npk_unbalanced.R top 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:

  • Three-way ANOVA of yield by N, P and K with all interactions, α = 0.05. Cell counts: N0·P0·K0, N0·P0·K1, N0·P1·K1 and N1·P1·K1 have 2 observations, the other four cells 3.
  • Sums of squares: MinutePlot computes Type II sums of squares for factorial ANOVA (each effect is the reduction in residual sum of squares when it is added to the model containing every term that does not contain it; order-independent, and identical to Type I and III on balanced data). R reference: car::Anova(fit, type = 2).
  • Blocks are omitted to match MinutePlot’s fully crossed design; this entry is a software comparison, not a recommended analysis of npk.
  • Pairwise comparisons of the eight cell means: Tukey HSD on the unbalanced cells; compact letters from the significant pairs (R: emmeans + multcomp::cld).

Side-by-side results

ANOVA summary (Type II; main effects and interactions)

MinutePlot®

TermdfFp
N1, 123.66970.0795
P1, 120.61290.4489
K1, 122.22020.1620
N × P1, 121.06840.3217
N × K1, 122.98140.1099
P × K1, 120.21510.6511
N × P × K1, 121.62000.2272

R

TermdfFp
N1, 123.66970.0795
P1, 120.61290.4489
K1, 122.22020.1620
N × P1, 121.06840.3217
N × K1, 122.98140.1099
P × K1, 120.21510.6511
N × P × K1, 121.62000.2272

R values: verified in R 4.5.2 (see the verdict).

Cell means with significance letters

MinutePlot®

NPKnMeanLetters
N1P1K0357.933a
N1P1K1252.300a
N1P0K0363.767a
N1P0K1354.667a
N0P1K0354.333a
N0P1K1251.000a
N0P0K0249.150a
N0P0K1255.250a

R

NPKnMeanLetters
N1P1K0357.933a
N1P1K1252.300a
N1P0K0363.767a
N1P0K1354.667a
N0P1K0354.333a
N0P1K1251.000a
N0P0K0249.150a
N0P0K1255.250a

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

All seven Type II F values and p-values identical to R’s car::Anova(type = 2) on the unbalanced cells (N 3.6697, P 0.6129, K 2.2202, N × P 1.0684, N × K 2.9814, P × K 0.2151, N × P × K 1.6200); letters identical -- no cell differs from any other (all a).

R script

npk_unbalanced.R — each script loads its data, prints its versions and the R-side tables shown above, in page order; no plotting.

R values verified in R 4.5.2 (emmeans 2.0.4, multcomp 1.4-32, multcompView 0.1-12, ez 4.5.0, Hmisc 5.3.0, pls 2.9.0, drc 3.0-1, car 3.1-5) on 16–17 September 2026.