Choose a chapter to open its worked examples in R.

The sixteen chapters

The pages follow the four parts of the book. Each one carries the book’s own section numbers, so a heading such as 3.9.2 — Measures of Association Strength is Section 3.9.2 of the book, and the Sections column below gives the sections of the chapter that the page works through.

Part I — Conceptual Bases of Experimental Design and Analysis

Chapter Sections What the companion covers
1 — The Logic of Experimental Design and Analysis 1.4 Fisher’s tea-tasting experiment derived from counting rules and the hypergeometric distribution, the randomization test on the Bayley twins data built from all 2n2^{n} sign patterns, and the base R groundwork the later pages assume.
2 — Drawing Valid Inferences from Experiments 2.3–2.5 The chapter’s quantitative claims made concrete: why low power is the most pervasive threat to statistical conclusion validity, what an unreliable dependent variable costs, how repeated testing inflates the Type I error rate, and the sample sizes behind large online experiments. All seven design schematics of Figures 2.1–2.7 are redrawn cell for cell.

Part II — Model Comparisons for Between-Subjects Designs

Chapter Sections What the companion covers
3 — Introduction to Model Comparisons: One-Way Between-Subjects Designs 3.5, 3.7, 3.9–3.11 The one-group and the general one-way case as a comparison of a full model with a restricted one, measures of effect and of association strength with their confidence intervals, checks of normality and homogeneity of variance together with transformations, and sample size planning for the FF test.
4 — Individual Comparisons of Means 4.4, 4.5, 4.7–4.10 A single question about a set of means posed as a contrast and tested by restricting that contrast to zero, complex comparisons, tests that do not pool unequal variances, effect size and association strength for a contrast, power, and what it means for a set of contrasts to be orthogonal.
5 — Testing Several Contrasts: The Multiple-Comparisons Problem 5.3–5.9, 5.11 Experimentwise against per-comparison error rates, then Bonferroni, Tukey’s HSD, Scheffé, Dunnett, comparisons with the best, Fisher’s LSD, and the false discovery rate — each matched to the question it answers, and the cost in power weighed at the end.
6 — Trend Analysis 6.4–6.8 A quantitative factor, where the groups differ in amount rather than in kind: the slope parameter and its confidence interval, the omnibus test for nonlinearity, and orthogonal polynomial contrasts isolating the quadratic and higher order shapes.
7 — Two-Way Between-Subjects Factorial Designs 7.4–7.7, 7.9, 7.10 Interaction in the 2 × 2 design, the omnibus main effects and interaction of the general two-way model, follow-ups by marginal contrasts, simple effects, and interaction contrasts, the sample size an interaction test demands, and Type I, II, and III sums of squares in unequal-nn designs.
8 — Higher-Order Between-Subjects Factorial Designs 8.1, 8.3, 8.5–8.7 What a three-way interaction means and what it does to the interpretation of the effects below it, simple effects and simple, simple main effects carrying the full model’s pooled error term, confidence intervals for single degree of freedom effects, and power.
9 — Designs with Covariates: ANCOVA and Blocking 9.4, 9.5, 9.10 The models and assumptions behind the analysis of covariance, what a well-chosen covariate buys in power and precision and what measurement error and nonrandom groups cost, the alternatives (residuals, gain scores, blocking, propensity score matching), and, when the slopes are not parallel, the Johnson–Neyman regions of significance.
10 — Designs with Random or Nested Factors 10.3, 10.4 Expected mean squares as the device that settles the denominator of each FF test — and shows the habit of dividing by MSWMS_{W} to be biased — in crossed designs and in nested designs, closing with association strength built from variance components: ω̂2\widehat{\omega}^{2} for a fixed factor and the intraclass correlation for a random one.

Part III — Model Comparisons for Designs Involving Within-Subjects Factors

Chapter Sections What the companion covers
11 — One-Way Within-Subjects Designs: Univariate Approach 11.5, 11.7–11.17 The repeated-measures FF test and the power it gains by removing individual differences, sphericity and compound symmetry, the ε̂\widehat{\varepsilon} and ε̃\widetilde{\varepsilon} adjustments for when they fail, comparisons and their confidence intervals, order effects and Latin squares, power, and the intraclass correlation as a reliability coefficient.
12 — Higher-Order Designs with Within-Subjects Factors: Univariate Approach 12.2–12.5 Two within-subjects factors, and the split-plot design with one factor of each kind, each with its own error terms and restricted models; simple effects, interaction contrasts, adjusted univariate tests, quasi-FF ratios, power, and Latin square designs.
13 — One-Way Within-Subjects Designs: Multivariate Approach 13.3–13.13 Repeated measures recast as DD variables, the omnibus multivariate test from the matrix formulation and its determinants, measures of effect, critical values for planned and for post hoc contrasts, and where the multivariate and the mixed-model approaches part company — on sphericity, on error terms, and on power.
14 — Higher Order Designs with Within-Subjects Factors: The Multivariate Approach 14.2–14.8, 14.11, 14.12 The multivariate approach for two within-subjects factors and for split-plot designs, free of the sphericity assumption; simple effects, interaction contrasts, and confidence intervals; longitudinal randomized designs, where adjusting for baseline outperforms a repeated-measures analysis of the raw scores; and power.

Part IV — Mixed-Effects Models

Chapter Sections What the companion covers
15 — An Introduction to Mixed-Effects Models: Within-Subjects Designs 15.5–15.7 Mixed-effects models for longitudinal data, which accommodate missing observations and let the covariance structure be modeled rather than assumed: random intercepts, random slopes, and straight-line change — each fit by restricted maximum likelihood and drawn as well as tabled — and the information criteria that weigh them against unstructured, compound-symmetry, and autoregressive covariance structures.
16 — An Introduction to Mixed-Effects Models: Nested Designs 16.4–16.7 Clustered data — clients within trainees, students within classrooms — handled by estimating the variance of the cluster effect: the mixed-effects analysis reproducing the ANOVA exactly at equal nn and going on where ANOVA cannot at unequal nn, predictors measured at two levels of the hierarchy, and sample size planning.

What is on each page

The pages cover the worked examples within the body of each chapter. The chapter exercises are listed in the book. Chapter 1 explains how to find the exercise data available in AMCP.

The R these pages use

AMCP supplies the book’s data. To work through the examples in R, install these packages from CRAN.

install.packages(c(
  "AMCP", "DMAR", "MASS", "MatchIt", "Superpower", "broom",
  "broom.mixed", "car", "dplyr", "effectsize", "emmeans", "ggplot2",
  "gt", "gtsummary", "lme4", "lmerTest", "modelsummary", "moments",
  "multcomp", "nlme", "patchwork", "psych", "pwr", "sjPlot", "tidyverse"
))

Chapter 1 explains how AMCP names the book’s data sets — chapter_1_table_1 holds Table 1.1 and C1T1 is its short form, with _exercise_ in place of _table_ for the data behind an end-of-chapter exercise — and the later pages assume that explanation.

Instructor materials

Instructors who have adopted the book may obtain the instructor materials from Ken Kelley (KKelley@ND.Edu) by sending their bookstore’s listing for the book or the syllabus on which it is a required text.

How to Cite These Pages

The book. Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing Experiments and Analyzing Data: A Model Comparison Perspective (4th ed.). New York, NY: Routledge.

These pages. Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). R code and instructions (companion materials for Designing Experiments and Analyzing Data: A Model Comparison Perspective, 4th ed.). https://DesigningExperiments.com

A single chapter. Cite that chapter’s page; each one carries its own citation at the bottom.

These examples use DMAR 1.2.0. The printed book predates DMAR.