Lite / Independent Engineering Research / Week 33
Standard errors and confidence intervals
'The new method is 0.3 s faster.' Plus or minus what? Without that, the sentence means almost nothing.
Why should I care?
Every comparison in your capstone will be reported as an estimate with an interval. Getting the standard error of a difference right is the single most used calculation in experimental research.
- Compute the standard error of a mean and of a difference of independent means.
- Construct and interpret a 95% confidence interval.
- Distinguish the SD of runs from the SE of a mean.
Predict
Two independent means each have SE 0.1 s. What is the SE of their difference?
- 0.1 s
- 0.2 s
- About 0.14 s
- 0 s
Guess first, then reveal
Variances add for independent estimates: √(0.1² + 0.1²) ≈ 0.141 s. Not 0.2 (that would add SEs) and not 0.1.
Discover
In the top panel, keep the difference at 0.3 and shrink the SE: watch the interval tighten. In the lower panel, set the true difference to 0.2 and run several sets of 20 replications. Count how many intervals miss the truth each time.
What the interactive shows (text version)
The top panel draws an estimate as a dot with a horizontal 95% interval, a dashed zero line and a green line for the smallest effect of interest. The lower panel draws 20 replicated intervals around a true value; intervals that miss it are shown dashed in red, and the readout counts them.
Watch (optional)
Watch for: Notice how the video builds an interval by resampling; you will do exactly this in week 34.
Builds the idea of a confidence interval from resampling before any formula, so the 95% stops sounding like magic.
“Confidence Intervals, Clearly Explained!!!” by StatQuest with Josh Starmer (opens YouTube; streaming video uses a lot of data)
The video is optional. Everything you need is in this lesson's text.
Understand
SD versus SE
The standard deviation s describes how much single runs vary. The standard error s/√n describes how much the mean would vary if you repeated the whole experiment. Error bars must say which they show; SE bars are √n times shorter.
What 95% confidence means
If you repeated the experiment many times and built an interval each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% probability the true value is in this particular interval, although for practical decisions the interval is your best summary of plausible values.
Small samples
With fewer than about 30 runs per group, replace 1.96 by the t critical value (for 10 degrees of freedom it is 2.23). Intervals get wider, honestly reflecting less information.
Explain it another way
Intuitive
An interval is a net cast at the truth. A 95% procedure catches it 19 times in 20; you never know which throw missed.
Technical
CI = estimate ± critical value × SE, with the critical value from the normal or t distribution at the chosen confidence level.
Mathematical
SE_diff = √(s₁²/n₁ + s₂²/n₂). Example: s₁ = 0.3, n₁ = 20, s₂ = 0.4, n₂ = 20 gives √(0.0045 + 0.008) = 0.112.
Applied
Paired seeds in simulation (same seed for baseline and method) often shrink the SE of the difference dramatically, because shared noise cancels.
Derivation: Standard error of a difference
Let X̄₁ and X̄₂ be means of independent samples, sizes n₁ and n₂, SDs σ₁ and σ₂.
Var(X̄ᵢ) = σᵢ²/nᵢ, because averaging n independent runs divides the variance by n.
For independent random variables, Var(X̄₁ − X̄₂) = Var(X̄₁) + Var(X̄₂): the minus sign does not cancel variance.
So SE_diff = √(σ₁²/n₁ + σ₂²/n₂), estimated with sample SDs s₁, s₂.
Approximate 95% CI: (x̄₁ − x̄₂) ± 1.96 · SE_diff for large samples; use the t critical value with Welch degrees of freedom for small ones.
Paired designs (same seed for both methods) use the SD of the per-seed differences instead, which is often much smaller.
Worked example 1
Baseline 2.40 s (s 0.30, n 25); new 2.15 s (s 0.35, n 25). 95% CI of the improvement?
SE = √(0.09/25 + 0.1225/25) = √0.0085 = 0.0922 s. Improvement 0.25 s ± 1.96 × 0.0922 = ± 0.181 → [0.069, 0.431] s.
Common mix-ups
The SE of a difference is the sum of the two SEs.
✓ For independent estimates you add variances, so SE_diff = √(SE₁² + SE₂²), which is smaller than SE₁ + SE₂.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
Write the formula, in code, that your capstone analysis will use to compute each comparison's difference and 95% CI. Test it on a made-up dataset where you know the answer.
Reflect
In your past projects, did your error bars show SD or SE? Did you say which?
Write your answer on paper or in your own notes. Lite never stores what you write.