Two-way ANOVA — unbalanced (unequal cell sizes)

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

Dataset

  • ToothGrowth with rows removed — ToothGrowth (R: datasets::ToothGrowth) with six rows removed by a fixed rule -- rows 1–4 (VC, dose 0.5) and rows 55–56 (OJ, dose 2.0) of the hosted toothgrowth.csv -- leaving 54 observations in six cells of unequal size.
  • Data format for MinutePlot: toothgrowth_unbalanced_minuteplot.csv — arranged exactly as the app’s data template for this test expects (paste it into the app).
  • Data format for R: toothgrowth_unbalanced_r.csv — the long-format file the R script reads (keep it in the script’s folder).

Setup

In MinutePlot:

  • Workbench → Two-way ANOVA → paste toothgrowth_unbalanced_minuteplot.csv (same layout; the removed replicates are empty cells, which the grid skips).
  • 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 toothgrowth_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:

  • Two-way ANOVA of len by supp and dose (as a factor) with interaction, α = 0.05. Cell counts: VC·0.5 = 6, OJ·2.0 = 8, the other four cells 10.
  • 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).
  • Pairwise comparisons of the six 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)

MinutePlot®

TermdfFp
supp1, 4811.32070.0015
dose2, 4869.5365< 0.0001
supp × dose2, 483.94590.0259

R

TermdfFp
supp1, 4811.32070.0015
dose2, 4869.5365< 0.0001
supp × dose2, 483.94590.0259

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

Cell means with significance letters

MinutePlot®

suppdosenMeanLetters
VC0.568.500c
VC1.01016.770b
VC2.01026.140a
OJ0.51013.230bc
OJ1.01022.700a
OJ2.0825.612a

R

suppdosenMeanLetters
VC0.568.500a
VC1.01016.770b
VC2.01026.140c
OJ0.51013.230ab
OJ1.01022.700c
OJ2.0825.612c

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

Type II F values 11.3207, 69.5365, 3.9459 and their p-values identical to R’s car::Anova(type = 2) on the unbalanced cells; letter groupings identical -- in the table’s order VC 0.5 / 1.0 / 2.0, OJ 0.5 / 1.0 / 2.0: R a, b, c, ab, c, c; MinutePlot c, b, a, bc, a, a (the same four-group structure read from opposite ends).

R script

toothgrowth_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.