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 runtoothgrowth_unbalanced.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 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®
| Term | df | F | p |
|---|---|---|---|
| supp | 1, 48 | 11.3207 | 0.0015 |
| dose | 2, 48 | 69.5365 | < 0.0001 |
| supp × dose | 2, 48 | 3.9459 | 0.0259 |
R
| Term | df | F | p |
|---|---|---|---|
| supp | 1, 48 | 11.3207 | 0.0015 |
| dose | 2, 48 | 69.5365 | < 0.0001 |
| supp × dose | 2, 48 | 3.9459 | 0.0259 |
R values: verified in R 4.5.2 (see the verdict).
Cell means with significance letters
MinutePlot®
| supp | dose | n | Mean | Letters |
|---|---|---|---|---|
| VC | 0.5 | 6 | 8.500 | c |
| VC | 1.0 | 10 | 16.770 | b |
| VC | 2.0 | 10 | 26.140 | a |
| OJ | 0.5 | 10 | 13.230 | bc |
| OJ | 1.0 | 10 | 22.700 | a |
| OJ | 2.0 | 8 | 25.612 | a |
R
| supp | dose | n | Mean | Letters |
|---|---|---|---|---|
| VC | 0.5 | 6 | 8.500 | a |
| VC | 1.0 | 10 | 16.770 | b |
| VC | 2.0 | 10 | 26.140 | c |
| OJ | 0.5 | 10 | 13.230 | ab |
| OJ | 1.0 | 10 | 22.700 | c |
| OJ | 2.0 | 8 | 25.612 | c |
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
toothgrowth_unbalanced.R — each script loads its data, prints its versions and the R-side tables shown above, in page order; no plotting.