Statistics 2nd ed

ANOVA

Students

For Students: How to Use statisticstextbook.com

A simple guide for starting, studying in order, and reviewing.

Audience: Pre-college and high school students

1. What This Site Is

statisticstextbook.com is a free, page-by-page statistics textbook. You can read it in order like a print book, or use it as a reference when you need help with a topic.

Most students do best by moving from the foundations (data, variability, probability) into core tests (t-tests and ANOVA), and then into modern topics (resampling, big data, and an introduction to machine learning).

2. How to Use This Textbook

  1. Start with the first lesson.
  2. Follow the Next / Previous links. Each lesson ends with navigation links so you can keep the correct order without guessing what comes next.
  3. Keep a small “definitions” page in your notes. Write down the meaning of key terms (mean, variance, standard deviation, probability, distribution) as you encounter them.
  4. For each test, practice three skills. (1) what the question is, (2) the computation, (3) the interpretation in words.
  5. Use the review pages when you get stuck.

3. Reading the Math

Formulas are displayed with MathJax so they stay clear on different screens. If a formula looks unfamiliar, read it slowly and connect each symbol to a meaning in words.

4. Why This Format Helps

  • Clear sequence: lessons build from basic ideas to core tests.
  • Readable math: formulas render cleanly across devices.
  • Study-friendly: minimal distractions and no sign-in required.
  • Open access: free to use for learning and review.

5. Summary

Use the textbook in order if you are learning statistics for the first time, and use it as a reference when you need a quick explanation or a worked example. If you study steadily and keep your own notes of definitions and interpretations, the material becomes much easier over time.

© 2025. This page uses MathJax with LaTeX delimiters \(…\) and \[…\] in Drupal Full HTML.

Appendix 8 — Glossary of Key Terms

Mean (average)
Sum of all scores divided by number of scores.
Example: (6 + 8 + 10) / 3 = 8.

Median
Middle score when data are ordered.
Example: For [5, 7, 8], median = 7.

Mode
Most frequent score.
Example: For [2, 3, 3, 5], mode = 3.

Variance (s²)
Average squared deviation from the mean.

Standard Deviation (s)
Square root of variance. Spread of scores around the mean.

Standard Error of the Mean (SEM)
How much sample means vary.
Formula: $$SEM = \frac{s}{\sqrt{n}}$$

t-test
Compares two means.

ANOVA (F-test)
Compares three or more means.

Post Hoc Test
Used after ANOVA to find which groups differ.

Correlation (r)
Strength and direction of a linear relationship. Range: –1 to +1.

Regression
Equation that predicts Y from X.
Example: $$\hat{Y} = a + bX$$

Chi-square (χ²)
Test for categorical data (counts).

Degrees of Freedom (df)
Independent pieces of information in a test.

p-value
Probability of getting the observed result (or more extreme) if the null hypothesis is true.


📱 QR: Interactive glossary (search symbols, formulas, definitions)

Practice self-test quiz

In the space below, please find practice problems and self-test quizzes. For full access, please signup free.

Appendix 6 — Data Sets for Practice

spreadsheet dataset

```html

Appendix 6 — Data Sets for Practice

Working with real numbers is the best way to learn statistics. This appendix provides small “mini datasets” you can analyze by hand (or with a calculator), plus larger files for practice with spreadsheets.


Dataset Provenance (Read This First)

  • Pedagogical = small, simplified numbers chosen to make learning and checking easier.
  • Simulated = computer-generated numbers designed to resemble real data (not collected from real people).
  • Empirical = collected from real observations (only used if explicitly stated).

Note: Unless a dataset is explicitly labeled Empirical, you should treat it as Pedagogical or Simulated practice data.


Mini Datasets (In-Page)

1) Quiz Scores

Provenance: Pedagogical
n: 10
Scale: Ratio (points)
Data: 6, 7, 8, 9, 10, 7, 8, 6, 9, 10

  • Suggested Lessons:
    • Lesson 2 — The Averages: mean, median, mode
    • Lesson 3 — Variance & Standard Deviation: variance, SD, z-scores
    • Lesson 4 — The Standard Normal Curve: interpret z-scores (as a bridge)
  • Check values (optional): Mean = 8.0; SD ≈ 1.41

2) Reaction Times (ms)

Provenance: Pedagogical (human-like values)
n: 8
Scale: Ratio (milliseconds)
Units: ms
Data: 220, 250, 270, 230, 260, 280, 240, 300

  • Suggested Lessons:
    • Lesson 3 — Variance & Standard Deviation: spread, outliers, SD
    • Lesson 6 — The t-test: use as a template dataset (e.g., compare two conditions by splitting into two groups)
    • Lesson 7 — ANOVA: extend to 3+ groups by creating conditions
  • Instructor tip: reaction time data often show mild skew in real life. If you want skew, see the larger practice files below.

3) Stress Reduction Scores (Three Groups)

Provenance: Pedagogical (grouped scores)
Scale: Interval/Ratio (score units; treat as interval for ANOVA practice)
Groups:

  • Meditation (n = 3): 65, 70, 72
  • Exercise (n = 3): 68, 71, 75
  • Music (n = 3): 75, 78, 82
  • Suggested Lessons:
    • Lesson 7 — ANOVA: one-way ANOVA (three independent groups)
    • Lesson 8 — Post Hoc Tests: follow-up comparisons after ANOVA (conceptual)
    • Lesson 13 — Degrees of Freedom Cookbook: df for one-way ANOVA
  • Important note: The sample sizes are intentionally small for learning mechanics. In real studies, groups are usually larger.

Larger Practice Datasets (Download Files)

These datasets are designed for spreadsheet work, graphing, and full problem sets.

  • Exam Scores (n = 100)
    Provenance: Simulated
    Suggested Lessons: Lesson 4 (normal curve), Lesson 5 (SEM), Lesson 6 (t-test foundations)
  • Survey Data (preferences by gender/age)
    Provenance: Simulated (categorical practice)
    Suggested Lessons: Lesson 12 (chi-square), Lesson 1 (why statistics matters in decisions)
  • Simulated Medical Trial (treatment vs. control, repeated measures)
    Provenance: Simulated (instructional “trial-style” dataset; not clinical research)
    Suggested Lessons: Lesson 6 (t-test concepts), Lesson 7 (variance partitioning concepts), and for advanced learners: repeated-measures ideas (optional)

Downloads: CSV and Excel files are provided via the QR code(s) on this page (and/or direct links, if enabled on your device).

Reproducibility note (simulated files): If you revise these datasets in future editions, consider generating them with a fixed random seed so instructors and students can reproduce results across versions.


Trusted External Sources (Optional)

If you want additional datasets beyond the practice files above, the following repositories are widely used for learning and benchmarking:

  • NIST Statistical Reference Datasets (SRD)
    High-quality benchmark datasets for practice and verification (excellent for checking calculations and software).
  • UCI Machine Learning Repository
    Larger, more complex datasets. Recommended only for advanced students or enrichment projects.

Visual Reference

Figure F.1 — Example spreadsheet view of a dataset (columns such as ID, Score, Group). Use this as a template for organizing your own data before running calculations.


Self-Test Quiz Access

Practice problems and self-test quizzes may appear below. If full access is restricted, please sign up (free) to unlock the quiz section.

```

Appendix 3 — Using the t-table and F-table

Online z-calculator (type z or x, get areas instantly)
F2,21
t-df22,0.01

Tables give the critical values we compare our test statistic against.
They depend on:

  • The significance level (α, often 0.05)
  • The degrees of freedom (df)

t-table

  • Rows = degrees of freedom (df)
  • Columns = significance level (α)

Example:

  • Independent-samples t-test with n₁ = 12, n₂ = 12
  • df = 12 + 12 – 2 = 22
  • At α = 0.05 (two-tailed) → critical t ≈ 2.07
  • If $$|t| \geq 2.07$$ → significant

F-table

  • Needs two df values:
    • df between (numerator)
    • df within (denominator)

Example:

  • One-way ANOVA, 3 groups, N = 24
  • df between = k – 1 = 2
  • df within = N – k = 21
  • At α = 0.05 → critical F ≈ 3.47
  • If computed F ≥ 3.47 → significant

Student Tips

  • Always compute df correctly.
  • Use tables if no software is available.
  • Most calculators or apps today give exact p-values — faster than tables.

📱 QR: Interactive critical value calculator (t and F tables online)


Visuals

Figure C.1 — Snippet of a t-table row (df = 22, α = 0.05 highlighted).
Figure C.2 — F-table grid with numerator df = 2, denominator df = 21 marked.


Practice self-test quiz

In the space below, please find practice problems and self-test quizzes. For full access, please signup free.

Appendix 1 — Symbols and Notation (Cheat Sheet)

Symbols and Notation

A quick reference to the symbols used in this book.

SymbolMeaningExample
$$\Sigma$$Summation (add them up)$$\Sigma X = 2+4+6=12$$
$$\bar{X}$$Sample mean$$\bar{X} = \tfrac{12}{3} = 4$$
$$\mu$$Population mean“The true average of all scores”
$$s$$Sample standard deviationSpread of quiz scores
$$\sigma$$Population standard deviationSpread of SAT scores
$$df$$Degrees of freedom$$df = n-1 = 29$$ if $$n=30$$
$$t$$t-test statisticCompare two group means
$$F$$ANOVA statisticCompare 3+ group means
$$r$$Pearson correlationStrength of linear relationship
$$R^2$$Coefficient of determinationProportion of variance explained
$$\chi^2$$Chi-square statisticCompare observed vs. expected counts
$$p$$Probability value“p < 0.05” → significant result

Practice self-test quiz

In the space below, please find practice problems and self-test quizzes. For full access, please signup free.

Part 5 — Statistical Tests (Cookbook Style)


Welcome to Part 5 — Statistical Tests (Cookbook Style) of this free online high school statistics textbook. This practical quick-reference section provides concise, cookbook-style guides to major parametric and non-parametric statistical tests, including detailed formulas, assumptions, degrees of freedom, step-by-step procedures, and real-world examples. High school students and teachers can quickly review when to use each test—perfect for AP Statistics exam preparation, homework help, or reinforcing concepts from earlier parts.

Ideal for quick lookups on ANOVA variants, non-parametric alternatives, and multi-group comparisons, Part 5 delivers clear explanations of one-way ANOVA, factorial ANOVA, repeated-measures ANOVA, mixed ANOVA, Mann-Whitney U, Wilcoxon, Kruskal-Wallis, and Friedman tests in an accessible format with worked examples.

Statistical Tests Covered in Part 5

  1. One-Way ANOVA – Comparing means across three or more independent groups, with formula, degrees of freedom, and example.
  2. Factorial ANOVA (Two-Way) – Analyzing main effects and interactions in 2×2 or larger designs, including df partition and example.
  3. Repeated-Measures ANOVA – Handling multiple measurements on the same subjects, with formula and example.
  4. Mixed (Split-Plot) ANOVA – Combining between-subjects and within-subjects factors, with formula and example.
  5. Mann-Whitney U Test – Non-parametric alternative for two independent samples, with formula and example.
  6. Wilcoxon Signed-Rank Test – Non-parametric option for paired or one-sample data, with procedure and example.
  7. Kruskal-Wallis Test – Non-parametric one-way ANOVA for three or more groups, with formula and example.
  8. Friedman Test – Non-parametric repeated-measures ANOVA, with formula and example.

A practice self-test quiz is available to test your understanding (optional signup for full interactive access). Use this free high school statistics resource as your go-to cookbook for statistical tests formulas, ANOVA examples, non-parametric tests guides, and quick reference during hypothesis testing!

One-way ANOVA

When to Use:

  • Compare means across 3 or more independent groups.
  • Interval/ratio data, groups independent, variances roughly equal.

Formula:
$$F = \frac{MS_{\text{between}}}{MS_{\text{within}}}$$

In words:
$$F = \frac{\text{mean square between groups}}{\text{mean square within groups}}$$

Example:
Three groups with means = 70, 75, 85.

  • $$SS_{\text{between}} = 300, , df_{\text{between}} = 2, , MS_{\text{between}} = 150$$
  • $$SS_{\text{within}} = 200, , df_{\text{within}} = 12, , MS_{\text{within}} = 16.7$$

$$F = \frac{150}{16.7} = 9.0, \quad df = (2, 12)$$


Factorial ANOVA (Two-way)

When to Use:

  • Two or more factors studied at once.
  • Tests main effects and interactions.

Formula (df partition):

  • $$df_A = a - 1, \quad df_B = b - 1$$
  • $$df_{A \times B} = (a-1)(b-1)$$
  • $$df_{\text{within}} = N - ab$$

Example:
2 × 2 design (Method: Lecture, Online × Time: Morning, Afternoon).

  • Lecture: Morning = 70, Afternoon = 90
  • Online: Morning = 80, Afternoon = 80

Interaction: Lecture improves over time, Online flat → non-parallel lines.


Repeated-Measures ANOVA

When to Use:

  • Same participants tested under multiple conditions.
  • Controls for subject variability.

Formula:
$$F = \frac{MS_{\text{conditions}}}{MS_{\text{error}}}$$

Degrees of Freedom:

  • $$df_{\text{rows}} = n - 1$$
  • $$df_{\text{columns}} = k - 1$$
  • $$df_{\text{error}} = (n-1)(k-1)$$

Example:
Five students tested across 3 conditions. Mean scores rise steadily from 70 → 75 → 80.


Mixed (Split-Plot) ANOVA

When to Use:

  • Combines a between-subjects factor with a within-subjects factor.
  • Common in psychology and education.

Formula (general):
$$F = \frac{MS_{\text{effect}}}{MS_{\text{error}}}$$

Degrees of Freedom:

  • $$df_{\text{between}} = a - 1$$
  • $$df_{\text{subjects}} = N - a$$
  • $$df_{\text{within}} = b - 1$$
  • $$df_{A \times B} = (a-1)(b-1)$$

Example:
Two groups (Drug, Placebo) × three weeks (repeated).
Drug scores rise each week, Placebo flat → interaction.


Mann–Whitney U Test

When to Use:

  • Compare two independent groups when data are ordinal or not normally distributed.
  • Non-parametric alternative to independent t-test.

Formula:
$$U = n_1 n_2 + \frac{n_1 (n_1 + 1)}{2} - R_1$$

Where $$R_1$$ = sum of ranks for group 1.

Example:
Two classrooms ranked by teacher ratings. Test whether distributions differ.


Wilcoxon Signed-Rank Test

When to Use:

  • Compare the same group measured twice (before vs. after).
  • Ordinal or non-normal data.
  • Non-parametric alternative to paired t-test.

Procedure:

  1. Compute differences (After – Before).
  2. Rank absolute differences.
  3. Assign signs.
  4. Test statistic = smaller of the two signed sums.

Example:
Five students’ skill ranks before vs. after training. Test whether median rank improved.


Kruskal–Wallis Test

When to Use:

  • Compare 3+ independent groups when data are ordinal or non-normal.
  • Non-parametric alternative to one-way ANOVA.

Formula:
$$H = \frac{12}{N(N+1)} \sum \frac{R_j^2}{n_j} - 3(N+1)$$

Where:

  • $$R_j$$ = sum of ranks for group j
  • $$n_j$$ = number of observations in group j
  • $$N$$ = total number of observations

Example:
Three therapy groups (n = 10 each) ranked by improvement scores.


Friedman Test

When to Use:

  • Compare 3+ related groups (repeated measures, ordinal data).
  • Non-parametric alternative to repeated-measures ANOVA.

Formula:
$$Q = \frac{12}{nk(k+1)} \sum R_j^2 - 3n(k+1)$$

Where:

  • $$R_j$$ = sum of ranks for each condition
  • $$n$$ = number of subjects
  • $$k$$ = number of conditions

Example:
Ten students ranked across 3 types of training tasks.

Practice self-test quiz

In the space below, please find practice problems and self-test quizzes. For full access, please signup free.

Identify the Design


Case 1

Scenario: A teacher compares test scores of students in two different classrooms (Class A vs. Class B).
Question: Are the two groups significantly different in mean score?
Answer: Independent-samples t-test.


Case 2

Scenario: A researcher tests the same group of students before and after tutoring.
Question: Did their scores improve after the program?
Answer: Paired-samples t-test (dependent t-test).


Case 3

Scenario: Three groups of students use different study methods: flashcards, highlighting, and practice tests.
Question: Do the study methods lead to different mean scores?
Answer: One-way ANOVA.


Case 4

Scenario: A psychologist measures anxiety scores in patients given three different drugs.
Question: Do the drugs produce different mean anxiety scores?
Answer: One-way ANOVA.


Case 5

Scenario: A study compares two groups of athletes: runners vs. swimmers, on reaction time.
Question: Are the two sports groups different in mean reaction time?
Answer: Independent-samples t-test.


Case 6

Scenario: Students are tested at three times: beginning, middle, and end of the semester.
Question: Did their scores change over time?
Answer: Repeated-measures ANOVA.


Case 7

Scenario: Two teaching methods (Lecture, Online) are tested across two times of day (Morning, Afternoon).
Question: What are the effects of method, time, and their interaction?
Answer: Two-way (factorial) ANOVA.


Case 8

Scenario: A company compares productivity of three work shifts (Day, Evening, Night) across two departments (Sales, Service).
Question: Are there main effects of shift and department, and is there an interaction?
Answer: Two-way (factorial) ANOVA.


Case 9

Scenario: Students are randomly assigned to a control or experimental group, and both groups are measured three times (Weeks 1, 2, 3).
Question: Is there an effect of group, time, and interaction?
Answer: Mixed (split-plot) ANOVA.


Case 10

Scenario: A survey asks students to choose their favorite subject: Math, Science, or English.
Question: Is the distribution of responses different from chance?
Answer: Chi-square goodness-of-fit test.


Case 11

Scenario: A researcher studies whether gender (Male, Female) is related to preference for sports (Soccer, Basketball, Tennis).
Question: Is there an association between gender and sport preference?
Answer: Chi-square test of independence.


Case 12

Scenario: Students are ranked by teacher ratings: 1st, 2nd, 3rd, etc. Two different teaching methods are compared on these ranks.
Question: Do the groups differ in median ranks?
Answer: Mann–Whitney U test (non-parametric).


Case 13

Scenario: The same students are ranked before and after a training program.
Question: Did the ranks change after training?
Answer: Wilcoxon signed-rank test (non-parametric).

Practice self-test quiz

In the space below, please find practice problems and self-test quizzes. For full access, please signup free.

Lesson 7 — Analysis of Variance (ANOVA)

anova layout
partitioning variance
2x2 factorial layout
factorial interaction
repeated measures anova
mixed anova layout
anova summary table

Lesson 7: Analysis of Variance (ANOVA)

The t-test is great for comparing two means. But what happens when you have three, four, or even more groups? Running multiple t-tests increases the chance of false positives (Type I error inflation). The solution is Analysis of Variance (ANOVA) — a powerful method that compares means across multiple groups in one test.

What ANOVA Does

ANOVA tests whether the means of several groups are significantly different from each other. It does this by partitioning (splitting) the total variability in the data into two parts:

  • Between-groups variability: Differences caused by the treatment or factor (the effect we care about).
  • Within-groups variability: Differences due to random chance or individual differences within each group (error or noise).

If between-groups variability is much larger than within-groups variability, the group means likely differ because of the treatment — not just chance.

The F Ratio — The Heart of ANOVA

The test statistic is the F ratio:

$$ F = \frac{MS_{\text{between}}}{MS_{\text{within}}} $$

In words:

$$ F = \frac{\text{Mean Square Between Groups}}{\text{Mean Square Within Groups}} $$

Where:

  • $$ MS_{\text{between}} = \frac{SS_{\text{between}}}{df_{\text{between}}} $$ (variance explained by the groups)
  • $$ MS_{\text{within}} = \frac{SS_{\text{within}}}{df_{\text{within}}} $$ (variance due to error)

A large F value suggests the between-groups differences are real, not random.

Degrees of Freedom in One-Way ANOVA

  • $$ df_{\text{between}} = k - 1 $$ (k = number of groups)
  • $$ df_{\text{within}} = N - k $$ (N = total number of observations)
  • $$ df_{\text{total}} = N - 1 $$

Example: One-Way ANOVA

Three groups of students use different study techniques:

  • Group A: mean = 70
  • Group B: mean = 75
  • Group C: mean = 85

Suppose calculations give:

  • $$ SS_{\text{between}} = 300 $$, $$ df_{\text{between}} = 2 $$ → $$ MS_{\text{between}} = 150 $$
  • $$ SS_{\text{within}} = 200 $$, $$ df_{\text{within}} = 12 $$ → $$ MS_{\text{within}} = 16.7 $$

Then:

$$ F = \frac{150}{16.7} \approx 9.0 $$

Compare F = 9.0 to the critical value from the F-table (df = 2, 12) ≈ 3.89 at p = 0.05. Since 9.0 > 3.89, the result is significant — the study techniques produce different mean scores.

Types of ANOVA

Factorial ANOVA

Tests two or more factors simultaneously (e.g., teaching method × time of day in a 2×2 design). It reveals:

  • Main effects of each factor
  • Interaction effects (when one factor's effect depends on the level of another)

Repeated-Measures ANOVA

Used when the same participants are measured multiple times (e.g., test scores before, during, and after a treatment). Removes individual differences, increasing statistical power.

Mixed (Split-Plot) ANOVA

Combines between-subjects (e.g., different treatment groups) and within-subjects (e.g., repeated measures over time) factors. Common in psychology, education, and clinical research.

Quick Summary

  • ANOVA generalizes the t-test to 3+ groups.
  • F ratio compares explained variance to error variance.
  • Large F → likely real differences between groups.
  • Types: one-way, factorial, repeated-measures, mixed.

Visuals

Figure 7.1 — One-way ANOVA: Bar chart showing group means with error bars.

Figure 7.2 — Variance partitioning: Total SS split into Between SS and Within SS.

Figure 7.3 — 2×2 Factorial design grid.

Figure 7.4 — Interaction plot: Non-parallel lines indicate interaction.

Figure 7.5 — Repeated-measures profile plot.

Figure 7.6 — Mixed ANOVA structure.

Figure 7.7 — Standard ANOVA summary table (Source | SS | df | MS | F | p).

Why ANOVA Matters

ANOVA is one of the most powerful and widely used tools in science. It helps researchers determine whether differences among groups are meaningful — not just random noise — making it essential for experiments in psychology, education, biology, medicine, and more.

Practice & Self-Test

Try the interactive self-test quiz below to check your understanding of ANOVA concepts, F ratio, and interpretation. For full access and more problems, sign up free.