School/□ Systems Engineer/Week 28
Is the difference real? Effect sizes and correlation
Greenhouse readings rise with the heater power, and also with the sunshine. Which one is warming the plants?
About 35 min · 3 goals · Checked by automated tests
1.Why should I care?
Optimisation means changing a design and claiming it got better. The claim needs a size, an uncertainty, and a reason to believe your change caused it rather than something that changed at the same time.
- ◇ Quantify a difference between two conditions with its standard error and an effect size.
- ◇ Interpret a correlation coefficient and explain why it does not establish cause.
- ◇ Name a confounding variable and design a comparison that controls it.
2.Predict
Design B's mean is 2 ms faster than A's. The SE of each mean is 1.5 ms. Is the difference convincing?
Guess first. Being wrong here is how the surprise works.
3.Discover
Do Level 2: find the glitch and the clean mean from the noisy readings, then use the heat balance. As you go, note which quantities you measured and which you inferred from a model.
Can't use the interactive? Read a description instead
In the greenhouse Build, Level 2 gives ten noisy thermometer readings, one of which is a glitch, and asks for the clean mean and predictions from the heat balance Q = UA·(T − T_out). The lesson's point: separate what you measured from what you inferred, and attach an uncertainty to each comparison.
4.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
SE_A = 0.3 W and SE_B = 0.4 W for two independent conditions. What is the SE of the difference of means, in W?
5.Watch
→ Listen for the three ways a correlation can arise without A causing B: reverse causation, a common cause, and coincidence.
Lurking variables and coincidences explained with everyday examples, before you trust a trend in your own data.
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.
6.Understand
The difference and its uncertainty
For independent conditions A and B, the difference of means d = x̄_B − x̄_A has standard error SE_d = √(SE_A² + SE_B²). A rough 95% interval is d ± 1.96·SE_d. If that interval comfortably excludes zero, the data support a real difference; if it straddles zero, you can't tell the sign yet.
Effect size: how big, not just whether
Cohen's d = (x̄_B − x̄_A)/s_pooled expresses the difference in units of run-to-run spread. d ≈ 0.2 is small, 0.8 large. With enough data even a trivially small effect becomes 'significant'; the effect size tells you whether anyone should care. Engineers usually prefer the raw difference in real units (ms, W, mm) plus its interval.
Correlation is a number, not a mechanism
Pearson's r runs from −1 to +1 and measures how well a straight line describes the relationship. r = 0.9 between heater power and temperature does not prove the heater warms the greenhouse: sunshine might raise both (the controller turns the heater down when it's sunny, which could even make r negative). Correlation also misses curved relationships entirely.
Control the confounders
A confounder affects both the thing you change and the thing you measure. Defeat it by design: change one variable at a time, randomise or interleave the order of conditions, and run both conditions under the same environment. In simulation you can hold the weather fixed exactly, which is one reason engineers simulate before field trials.
Explain it another way
Ice-cream sales and sunburn rise together. Ice cream doesn't burn you: sunny days drive both.
Welch's approach: SE_d = √(s_A²/n_A + s_B²/n_B). Pearson r = cov(x, y)/(s_x·s_y). r² is the fraction of variance in y explained by a linear fit on x.
For independent X and Y, Var(X − Y) = Var(X) + Var(Y), the same rule that will appear as uncertainty propagation next week. Covariance is the expected product of deviations: cov(x, y) = Σ(xᵢ − x̄)(yᵢ − ȳ)/(n − 1).
Clinical trials randomise patients so that unknown confounders are spread evenly across treatment and control. A/B tests on software do the same by randomly assigning users to versions.
Worked example 1
A: mean 40.0 ms, SE 0.6. B: mean 38.2 ms, SE 0.8. Give the difference with a 95% interval.
d = 38.2 − 40.0 = −1.8 ms. SE_d = √(0.36 + 0.64) = 1.0 ms. Interval: −1.8 ± 1.96 → −3.8 to +0.2 ms. It just includes 0, so the evidence for B being faster is suggestive, not conclusive.
Common mix-ups
- If two numbers differ, one condition is better.
✓ A difference smaller than about two standard errors of the difference is easily produced by noise. - A high correlation proves cause and effect.
✓ Correlation can come from a common cause, reverse causation or chance. Causation needs a controlled comparison.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
A team tests firmware v2 on Monday morning and v1 on Friday afternoon, when the lab is warmer. v2 uses less power. What is the main problem?
Practice 3
Across 50 rover drives, wheel slip and battery drain have r = 0.85. What can you conclude?
Practice 4 · a fresh version every time
After warm-up, the baseline takes a mean of 24 ms per run and the optimised version 10 ms (same machine, same input, interleaved runs). What is the speed-up, baseline time ÷ new time? (3 significant figures.)
8.Apply it
Find a claimed improvement in a product review or a project of your own. Write down: the difference, its uncertainty (or why it's missing), one possible confounder, and how you'd redesign the test.
9.Reflect
Concepts: Comparing conditions with uncertainty · Describing data · Experimental design and test protocols