Early access: free for now
Tools
All tools

Core and experimental design

ManualHow to Cite

Free tool aStat · Agriculture Statistics

ANOVA Calculator: One-Way, Two-Way and RCBD with Tukey Test

Paste your groups or open a spreadsheet and get the full ANOVA table, F and p value, effect size, post hoc tests with letters (a, b, c), assumption checks and a graph, explained in plain words. Tukey, Duncan, LSD, Bonferroni, Šidák, Scheffé and Dunnett.

  • Free, no sign-up
  • Your data stay on your computer
  • Realtime R in your browser
  • R script included

One column per group (treatment), copied straight from Excel. Groups can have different numbers of values. For two-way ANOVA or blocks, paste a table with named columns, one row per plot or animal.

Or start from a file

Or try an example

Files are read in your browser; nothing is uploaded.

Quick answers

What does ANOVA stand for?
Analysis of variance. It compares the means of two or more groups by splitting the total variation into variation between groups and within groups.
What does an ANOVA test tell you?
Whether at least one group mean differs from the others. A p value below 0.05 says the groups are not all equal; a post hoc test then says which ones differ.
One-way or two-way ANOVA?
One-way (CRD) when you compare one factor, such as five diets. Two-way when you test two factors together, such as variety and nitrogen, and their interaction.
When should I use ANOVA instead of a t test?
Whenever you compare three or more groups. Running many t tests raises the chance of a false difference; ANOVA tests them all at once.
What is the Tukey test?
Tukey's HSD (honestly significant difference) compares every pair of means after an ANOVA while keeping the overall error rate at 5%.
Is CRD the same as one-way ANOVA?
Yes. A completely randomized design (CRD) is analyzed with a one-way ANOVA. With blocks, the design is an RCBD and the ANOVA includes the block.
On this page
  1. Quick answers
  2. What is ANOVA (analysis of variance)?
  3. One-way (CRD), RCBD or two-way: which ANOVA do you need?
  4. When to use ANOVA (and when a t test is enough)
  5. How to read the ANOVA table (with formulas)
  6. How to interpret ANOVA results
  7. Post hoc tests: Tukey HSD, Duncan, LSD and others
  8. Reading the letters (a, b, c) on means
  9. ANOVA assumptions, and what to do if they fail
  10. ANOVA in Excel, R and SPSS
  11. How to report ANOVA results (APA style)
  12. Questions people ask
  13. Sources

What is ANOVA (analysis of variance)?

ANOVA tests whether the means of several groups are equal. Instead of comparing groups two at a time, it asks one question: is the variation between the group means larger than you would expect from the variation among plots or animals treated alike? R. A. Fisher developed it in the 1920s for field experiments, which is why it is still the standard analysis in agriculture.

  • Null hypothesis (H₀): all group means are equal (μ₁ = μ₂ = … = μₖ).
  • Alternative (research) hypothesis (H₁): at least one group mean differs from the others.
  • The test statistic is F: the variance between groups divided by the variance within groups. A large F and a small p value mean the treatment made a difference.

One-way (CRD), RCBD or two-way: which ANOVA do you need?

Pick the design by how the experiment was laid out, not by the software menu. The common names are in the first column:

Design (what it is called)LayoutANOVA
CRD, completely randomized designTreatments assigned to plots or animals completely at randomOne-way ANOVA
RCBD, randomized complete block designEach treatment once in every block (field strip, barn, litter, day)Two-way ANOVA without interaction: treatment + block
Factorial (two-factor) designEvery combination of two factors, such as 3 varieties × 4 nitrogen rates, with replicatesTwo-way ANOVA with interaction
Split-plot, Latin square, repeated measuresTwo sizes of plot, row and column blocks, or the same animals measured over timeMixed models: use the full aStat analysis

The calculator handles the first three. If your design is in the last row, open your data in aStat: it recognizes the layout and fits the right model.

When to use ANOVA (and when a t test is enough)

  • Two groups: a t test and a one-way ANOVA give the same p value (F = t²). Either is fine.
  • Three or more groups: use ANOVA. Ten t tests among five groups would give about a 40% chance of at least one false "significant" difference at the 5% level; ANOVA followed by a post hoc test keeps that at 5%.
  • Two factors, or blocks: use two-way ANOVA or the RCBD analysis, so the block or second factor is not left in the error.
  • Counts, yes/no outcomes or very skewed data: check normality first; a generalized linear model or the Kruskal-Wallis test may fit better.

How to read the ANOVA table (with formulas)

Every ANOVA table has the same columns. For k groups and N values in total:

ColumnMeaningFormula
dfDegrees of freedomBetween: k − 1. Within (error): N − k. Total: N − 1
SSSum of squaresBetween: Σ nᵢ(ȳᵢ − ȳ)². Within: Σ (y − ȳᵢ)². Total = between + within
MSMean square (a variance)MS = SS / df
FF statisticF = MS between / MS within
pp valueProbability of an F this large if all means were equal (F distribution with the two df)

Worked example

Three diets, four animals each: A = 4, 5, 6, 5 (mean 5); B = 7, 8, 6, 7 (mean 7); C = 9, 8, 10, 9 (mean 9). The grand mean is 7.

SourcedfSSMSFp
Diet (between)23216.0024.00.0002
Error (within)960.67
Total1138

SS between = 4 × [(5 − 7)² + (7 − 7)² + (9 − 7)²] = 32. SS within adds the squared deviations from each diet's own mean: 2 + 2 + 2 = 6. F = 16.00 / 0.67 = 24.0 with 2 and 9 df, p = 0.0002 (checked in R).

Completing an ANOVA table with missing values

Use the relationships above: total df and SS are the sums of the rows; each MS is its SS divided by its df; F is the two mean squares divided. With any two of SS, df and MS in a row you can find the third, and with both mean squares you have F.

How to interpret ANOVA results

  1. Read the F test. p < 0.05: the group means are not all equal. p ≥ 0.05: no evidence of a difference (which is not proof that the means are equal).
  2. Look at the size of the effect. Eta squared (η²) = SS between / SS total is the share of the variation explained by the treatment. In the example, 32 / 38 = 0.84.
  3. Find which groups differ with a post hoc test, shown as letters on the means.
  4. Check the assumptions: residuals roughly normal and similar spread in each group.
  5. For two-way ANOVA, read the interaction first. A significant interaction means the effect of one factor depends on the other: compare the simple effects instead of the main effects.

The calculator does all five and writes the answer in a sentence above the tables.

Post hoc tests: Tukey HSD, Duncan, LSD and others

A significant F says the means differ somewhere. A post hoc (multiple comparison) test says where. The calculator offers all the common ones:

TestWhat it doesUse it when
Tukey HSDAll pairs; controls the overall error rate. Tukey-Kramer when group sizes differThe default for comparing all treatments
Duncan's multiple range test (DMRT)All pairs; less conservative than TukeyA journal or field expects it; common in agronomy
Fisher's LSDAll pairs with no adjustmentFew planned comparisons, after a significant F
Bonferroni and ŠidákAdjust each p value for the number of comparisonsA small set of comparisons
SchefféVery conservative; covers any contrastComplex comparisons, not just pairs
DunnettEach treatment against one controlYou only care about differences from the control

How to interpret a Tukey test

Each pair gets a difference, a confidence interval and an adjusted p value. If the interval excludes zero (p < 0.05), the two means differ. In the example, Tukey's HSD is 1.61: diets whose means differ by more than 1.61 are significantly different, so all three diets differ (A–B and B–C p = 0.018, A–C p < 0.001).

Reading the letters (a, b, c) on means

Journals summarize post hoc results with letters: means that share a letter are not significantly different; means with no letter in common are. The highest mean usually gets "a". An illustrative nitrogen trial:

TreatmentMean yield (t/ha)LettersReading
100 N8.4aHighest
50 N7.9abNot different from 100 N or from 25 N
25 N7.3bLower than 100 N
0 N6.7cLower than all others

The calculator puts the letters on the graph and in the table; Graph Maker exports the graph at journal size.

ANOVA assumptions, and what to do if they fail

  • Independence: each value comes from a separate plot or animal, randomly assigned. Repeated measurements on the same animal need a mixed model.
  • Normal residuals: check with the Normality Test on the residuals. ANOVA is fairly robust to mild departures, especially with equal group sizes.
  • Equal variances: similar spread in every group (Levene's test). If one group is much more variable, use Welch's ANOVA, which aStat reports alongside.

If the residuals are clearly not normal, transform the data (log for right-skewed values), use a model for counts or proportions, or use the Kruskal-Wallis test. The calculator flags each problem in the checks above the tables.

ANOVA in Excel, R and SPSS

Excel

  1. Turn on the Analysis ToolPak (File › Options › Add-ins).
  2. Put each group in its own column, then Data › Data Analysis › Anova: Single Factor.
  3. For two factors, use Anova: Two-Factor With Replication (needs equal replicates in every cell).

Excel stops at the ANOVA table: no post hoc tests, no letters, no assumption checks and no blocks with unequal data. Paste the same columns into the calculator above to get all of them.

R

fit <- aov(yield ~ diet, data = dat)   # one-way (CRD)
summary(fit)                            # ANOVA table
TukeyHSD(fit)                           # Tukey HSD
# RCBD: aov(yield ~ diet + block, data = dat)
# two-way: aov(yield ~ variety * nitrogen, data = dat)

The calculator's R script uses emmeans for the comparisons and letters, and runs as is in R or RStudio.

SPSS

  • One-way: Analyze › Compare Means › One-Way ANOVA › Post Hoc › Tukey (or Duncan, LSD).
  • Two-way or RCBD: Analyze › General Linear Model › Univariate, with both factors (or treatment and block) as fixed factors.

How to report ANOVA results (APA style)

Give F with both degrees of freedom, the p value, an effect size, and the post hoc result:

  • "Diet affected weight gain, F(2, 9) = 24.00, p < .001, η² = .84. Tukey's HSD showed that all three diets differed (p ≤ .018)."
  • "Variety and nitrogen interacted, F(6, 24) = 3.12, p = .021, so nitrogen effects are reported within each variety." (illustrative numbers)

In tables, show means with their SE and the letters, and say in the caption which test made the letters.

Questions people ask

Can I use ANOVA with only two groups?

Yes. With two groups, one-way ANOVA and the two-sample t test give the same p value (F = t²).

What is a good F value?

There is no fixed cutoff: how large F must be depends on the degrees of freedom. Judge it by the p value; F near 1 means the groups vary no more than chance.

The ANOVA is significant but Tukey finds no differing pairs. Why?

The F test can detect a pattern spread across several means that no single pair shows. Report the F test, and say that no pairwise difference reached significance.

Can groups have different numbers of values?

Yes. Paste them as columns of different lengths. The calculator uses the Tukey-Kramer adjustment for unequal group sizes.

How many replicates do I need?

It depends on how large a difference matters and how variable your measurement is. Use Plan a study in aStat to work out the number of plots or animals.

Can I run ANOVA from means and standard deviations?

Not in this calculator yet; it needs the individual values, which also allows the assumption checks. Summary-statistics input is planned.

Sources

  • Fisher, R. A. (1925). Statistical Methods for Research Workers. Oliver and Boyd.
  • Tukey, J. W. (1949). Comparing individual means in the analysis of variance. Biometrics, 5(2), 99–114.
  • Duncan, D. B. (1955). Multiple range and multiple F tests. Biometrics, 11(1), 1–42.
  • Dunnett, C. W. (1955). A multiple comparison procedure for comparing several treatments with a control. Journal of the American Statistical Association, 50(272), 1096–1121.
  • Gomez, K. A., and Gomez, A. A. (1984). Statistical Procedures for Agricultural Research (2nd ed.). Wiley.
  • emmeans R package (estimated marginal means and comparisons) · R documentation: TukeyHSD