Skip to content
Tactiverge

School/✦ Research Engineer/Week 32

Randomisation and confounding

You test gripper A all morning and gripper B all afternoon. B looks worse. Is it the gripper, or the tired battery?

About 45 min · 3 goals · Checked by automated tests

1.Why should I care?

Confounders are the most common reason a careful-looking experiment gives the wrong answer. Randomisation is the cheapest protection ever invented: it costs nothing but a seed.

  • ◇ Identify a confounder that varies with the condition.
  • ◇ Compare blocked, alternating, counterbalanced and randomised trial orders.
  • ◇ Explain why repeating a confounded design does not remove its bias.

2.Predict

True effect 0, battery drains steadily, all A trials first then all B. On average, what will B − A show?

Guess first. Being wrong here is how the surprise works.

3.Understand

Confounders

A confounder affects the outcome and changes along with the condition. Time of day, battery level, simulator warm-up, operator fatigue and the order of trials are classic ones. If a confounder is perfectly aligned with the condition, no statistics can separate them.

Breaking the link

Randomising the order makes the confounder independent of the condition on average. Counterbalancing (ABBA) cancels linear drift by design. Blocking groups trials by a known nuisance (e.g. per battery) and compares within blocks. All are better than 'all A then all B'.

Bias versus noise

Randomisation turns bias into noise: the confounder still adds variation, but it no longer pushes the estimate one way. More runs then shrink the noise. More runs of a confounded design only make you more confident in the wrong answer.

Explain it another way

If you always test the new shoes on downhill runs and the old ones uphill, the new shoes will look fast whatever they are.

Worked example 1

Drift lowers scores by 10 points over a 24-trial session. Blocked order, no true effect. Expected estimate?

A trials sit at positions 0–11 (average drop ≈ 2.4), B at 12–23 (≈ 7.6). Estimate ≈ −5.2: a false effect about half the total drift.

Common mix-ups

  • Alternating ABAB is as good as randomising.
    ✓ Alternation handles slow drift but can align with any periodic nuisance; randomisation protects against confounders you have not thought of.

4.Discover

Set the true effect to 0 and drift to 10. Compare the bias over 300 repeats for each trial order. Then set drift to 0: does the order still matter? Finally set a true effect of 2 with drift 10: which schedule recovers it?

Loading the interactive…

Can't use the interactive? Read a description instead

The confounding simulator plots 24 trial scores in order; circles are condition A and squares condition B. A battery drift lowers later trials. Choosing the order (blocked, alternating, ABBA, randomised) changes the estimated effect; the readout gives the average bias over 300 repeated sessions.

5.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

Which is a confounder in 'all baseline runs on Monday, all new-method runs on Tuesday'?

6.Watch

→ Note how random assignment and blinding are introduced, and which confounders each protects against.

Control groups, randomisation and blinding: the ideas that make a comparison fair, explained with everyday examples.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

Why does ABBA ordering cancel linear drift?

Practice 3

Drift lowers scores linearly by 8 points across a session; blocked A-then-B with equal halves. Approximate bias in B − A?

points

Practice 4

A confounded design is repeated with 10× more runs. What happens?

Practice 5

You randomise trial order in code. What must you record?

8.Apply it

List three possible confounders in your capstone (including order and simulator state). For each, say whether you will randomise, counterbalance, block or hold it fixed, and record the seed you will use.

9.Reflect

Concepts: Variables, controls and confounders · Experimental design and test protocols