Skip to content

Sample size: 2 × 2 designs, A/B tests and repeated trials - #47

Merged
PeterSlijkhuis merged 1 commit into
mainfrom
power-scenarios
Sep 30, 2026
Merged

PeterSlijkhuis merged 1 commit into
mainfrom
power-scenarios

Conversation

@PeterSlijkhuis

@PeterSlijkhuis PeterSlijkhuis commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Before: the sample size page had no 2 × 2 designs, so there was no plan for a before-and-after study with a control group. It never mentioned A/B tests, and it didn't say what to do when people do each condition several times.

After: a new design, "Two factors at once, like a 2 × 2 design", asks two things: whether each factor is between people, within people or one of each, and whether the question is about the interaction or a main effect. In plain words, an interaction is described by its shape: the effect disappears, halves or reverses. A/B tests are pointed to the two-group or yes/no design, and repeated trials are planned on each person's average.

How: every effect in a 2 × 2 design has 1 df, so its test is a t-test on one contrast, with λ = N·f² in every layout and df2 = N − 4, N − 2 or N − 1. The between-subjects case matches G*Power's "fixed effects, special" (128 people for f = .25). Mixed and within designs match 2000-run simulations in R. The page's R code is base R and is checked in CI like the other designs.

@PeterSlijkhuis
PeterSlijkhuis merged commit 72f7a89 into main Sep 30, 2026
4 checks passed
@PeterSlijkhuis
PeterSlijkhuis deleted the power-scenarios branch October 1, 2026 07:17

This branch was successfully deployed

1 active deployment
github-pages — 72f7a893 Deployed Sep 30, 2026 by PeterSlijkhuis via deploy #124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant