Loading…

ANOVA Calculator: One-Way ANOVA F-Test Worked Example

Using a one-way ANOVA, how are the F statistic and p-value calculated for three groups of sample data, and what decision is made at α = 0.05?

Subject: Statistics Chapter: Analysis of Variance Topic: One Way Anova Hypothesis Test Answer included
anova calculator one-way ANOVA analysis of variance F test F statistic between-group variation within-group variation mean square
Accepted answer Answer included

Problem setup (one-way ANOVA)

An anova calculator for a one-way ANOVA compares the means of \(k\) independent groups by splitting total variability into between-group and within-group components. Consider three groups (each \(n=5\)):

Group Observations \(n_j\) \(\bar{x}_j\)
A 8, 9, 6, 7, 10 5 8.0
B 5, 4, 6, 5, 3 5 4.6
C 9, 10, 12, 11, 9 5 10.2

Hypotheses (one-way ANOVA):

\(H_0:\ \mu_A=\mu_B=\mu_C\) (all population means equal)
\(H_1:\) at least one population mean differs

Standard conditions: independent observations, approximately normal errors within each group, and roughly equal population variances.

Step 1: Compute the overall mean

Total sample size \(N = 5 + 5 + 5 = 15\). The overall mean is \[ \bar{x}=\frac{\sum_{j=1}^{k}\sum_{i=1}^{n_j} x_{ij}}{N}. \]

Group sums: \(A:40\), \(B:23\), \(C:51\). Hence \(\sum x_{ij}=40+23+51=114\), so \[ \bar{x}=\frac{114}{15}=7.6. \]

Step 2: Between-group sum of squares \(SSB\)

\[ SSB=\sum_{j=1}^{k} n_j \cdot (\bar{x}_j-\bar{x})^2. \]

Group \(\bar{x}_j-\bar{x}\) \((\bar{x}_j-\bar{x})^2\) \(n_j \cdot (\bar{x}_j-\bar{x})^2\)
A \(8.0-7.6=0.4\) 0.16 \(5 \cdot 0.16=0.8\)
B \(4.6-7.6=-3.0\) 9.00 \(5 \cdot 9.00=45.0\)
C \(10.2-7.6=2.6\) 6.76 \(5 \cdot 6.76=33.8\)

Therefore, \[ SSB = 0.8 + 45.0 + 33.8 = 79.6. \]

Step 3: Within-group sum of squares \(SSW\)

\[ SSW=\sum_{j=1}^{k}\sum_{i=1}^{n_j} (x_{ij}-\bar{x}_j)^2. \]

This measures variation inside each group around its own sample mean.

Group \(\sum (x_{ij}-\bar{x}_j)^2\) Computation (squared deviations)
A (\(\bar{x}_A=8.0\)) 10.0 \((0)^2+(1)^2+(-2)^2+(-1)^2+(2)^2=0+1+4+1+4\)
B (\(\bar{x}_B=4.6\)) 5.2 \((0.4)^2+(-0.6)^2+(1.4)^2+(0.4)^2+(-1.6)^2=0.16+0.36+1.96+0.16+2.56\)
C (\(\bar{x}_C=10.2\)) 6.8 \((-1.2)^2+(-0.2)^2+(1.8)^2+(0.8)^2+(-1.2)^2=1.44+0.04+3.24+0.64+1.44\)

Hence, \[ SSW = 10.0 + 5.2 + 6.8 = 22.0. \]

Step 4: Degrees of freedom, mean squares, and the F statistic

With \(k=3\) groups and \(N=15\): \[ df_B = k-1 = 2,\qquad df_W = N-k = 12. \]

Mean squares: \[ MSB=\frac{SSB}{df_B}=\frac{79.6}{2}=39.8,\qquad MSW=\frac{SSW}{df_W}=\frac{22.0}{12}=1.8333\ldots \]

Test statistic: \[ F=\frac{MSB}{MSW}=\frac{39.8}{1.8333\ldots}=21.7091\ldots\approx 21.71. \]

Step 5: Decision using p-value (and critical value)

Under \(H_0\), \(F\sim F(df_B,df_W)=F(2,12)\). The right-tail p-value is \[ p=P\!\left(F(2,12)\ge 21.71\right)\approx 0.00010. \]

At \(\alpha=0.05\), the critical value is \(F_{0.95}(2,12)\approx 3.885\). Since \(21.71>3.885\) (equivalently \(p<0.05\)), the null hypothesis is rejected.

\(F \approx 21.71\) \(df=(2,12)\) \(p \approx 0.00010\) \(\alpha=0.05\)

Conclusion: The group means are not all equal; at least one mean differs.

A one-way ANOVA indicates a difference exists, but it does not identify which pairs differ; a post hoc procedure (e.g., Tukey HSD) is used for pairwise comparisons after significance.

Visualization: F distribution with the observed statistic

The plot shows the \(F(2,12)\) density, the critical value at \(\alpha=0.05\), and the observed \(F\) from the ANOVA table. The shaded region represents the right-tail area used for the p-value.

Right-tail test for one-way ANOVA: reject \(H_0\) when \(F\) falls far into the right tail of the \(F\) distribution.

ANOVA table (summary)

Source SS df MS F
Between groups 79.6 2 39.8 21.71
Within groups (error) 22.0 12 1.8333
Total 101.6 14
Vote on the accepted answer
Upvotes: 0 Downvotes: 0 Score: 0
Community answers No approved answers yet

No approved community answers are published yet. You can submit one below.

Submit your answer Moderated before publishing

Plain text only. Your name is required. Links, HTML, and scripts are blocked.

Fresh

Most recent questions

109 questions · Sorted by newest first

Showing 1–10 of 109
per page
  1. Mar 5, 2026 Published
    Formula of the Variance (Population and Sample)
    Statistics Numerical Descriptive Measures Measures of Dispersion for Ungrouped Data
  2. Mar 5, 2026 Published
    Mean Median Mode Calculator (Formulas, Interpretation, and Example)
    Statistics Numerical Descriptive Measures Measures of Central Tendency for Ungrouped Data
  3. Mar 4, 2026 Published
    How to Calculate Standard Deviation in Excel (STDEV.S vs STDEV.P)
    Statistics Numerical Descriptive Measures Measures of Dispersion for Ungrouped Data
  4. Mar 4, 2026 Published
    Suppose T and Z Are Random Variables: How T Relates to Z in the t Distribution
    Statistics Estimation of the Mean and Proportion Estimation of a Population Mean σ Not Known the T Distribution
  5. Mar 4, 2026 Published
    What Does R Squared Mean in Statistics (Coefficient of Determination)
    Statistics Simple Linear Regression Coefficient of Determination
  6. Mar 3, 2026 Published
    Box and Plot Graph (Box Plot) Explained
    Statistics Numerical Descriptive Measures Box and Whisker Plot
  7. Mar 3, 2026 Published
    How to Calculate a Z Score
    Statistics Continuous Random Variables and the Normal Distribution Standardizing a Normal Distribution
  8. Mar 3, 2026 Published
    How to Calculate Relative Frequency
    Statistics Organizing and Graphing Data Organizing and Graphing Quantitative Data
  9. Mar 3, 2026 Published
    Is zero an even number?
    Statistics Numerical Descriptive Measures Measures of Central Tendency for Ungrouped Data
  10. Mar 3, 2026 Published
    Monty Hall Paradox (Conditional Probability Explained)
    Statistics Probability Marginal and Conditional Probabilities
Showing 1–10 of 109
Open the calculator for this topic