Shuffle to test a difference

Use random assignments to understand how surprising a difference is

Hold the scores fixed

AB3412A − B = 2
Same scores, different labels.

Four participants score 1, 2, 3 and 4. Conditions A and B were assigned at random, two people per condition. A has 3 and 4, so the mean difference A − B is 3.5 − 1.5 = 2.

More

Assume neither condition changes anyone’s score. Under this assumption, the same scores could have received different labels. Choose any two of the four participants for A: there are C(4, 2) = 6 equally likely assignments.

Lesson help

A randomization calculation needs both a rule for what counts as extreme and a rule for which assignments are possible.

About this lesson

Try the method in a practice when you are ready.

Report

Hold the scores fixed

Four participants score 1, 2, 3 and 4. Conditions A and B were assigned at random, two people per condition. A has 3 and 4, so the mean difference A − B is 3.5 − 1.5 = 2.

Assume neither condition changes anyone’s score. Under this assumption, the same scores could have received different labels. Choose any two of the four participants for A: there are C(4, 2) = 6 equally likely assignments.

AB3412A − B = 2
Same scores, different labels.

Count differences at least as extreme

The six differences between the means are −2, −1, 0, 0, 1 and 2. For a two-sided question, count differences at least 2 away from zero. Both −2 and 2 count, giving 2/6 = 1/3.

This fraction is the chance of a difference at least this extreme under the no-effect assumption. It is not the chance that the assumption is true. If the question had specified only a positive difference of at least 2, just one assignment would count: 1/6.

−2−10122/6 = 1/3
Count both directions, including the boundary.

Keep the original randomization rule

Now suppose the experiment used two matched pairs: scores (1, 3) and (2, 4). Within each pair, a random choice assigned one person to A and the other to B.

There are only 2 × 2 = 4 valid assignments. Their mean differences are −2, 0, 0 and 2. You may swap labels within a pair, but you must not redistribute people freely between the pairs.

1324−2, 0, 0, 2
Paired assignment has a different set of valid shuffles.

Try it

In the paired experiment, what fraction of valid assignments give a mean difference at least 2 away from zero?

  1. 1/3
  2. 1/2
Show the answer

1/2

Yes. Two of the four allowed assignments give −2 or 2, so the fraction is 2/4 = 1/2.

Enable JavaScript to answer interactively and save your place.

Practice Signal or chance?

Sign in free

Practice without limits and keep your progress.