Skip to content
Tactiverge

School/✦ Research Engineer/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.

About 45 min · 3 goals · Checked by automated tests

1.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.

2.Predict

Two independent means each have SE 0.1 s. What is the SE of their difference?

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

3.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.

Loading the interactive…

Can't use the interactive? Read a description instead

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.

4.Checkpoint: guided practice

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

Practice 1 · a fresh version every time

Baseline: n1 = 30 trials, s1 = 0.1 m. New method: n2 = 30 trials, s2 = 0.3 m (independent groups, rover final position error). What is the standard error of the difference in means, in m?

m

5.Watch

→ 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.

6 min 41 s · 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

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

An interval is a net cast at the truth. A 95% procedure catches it 19 times in 20; you never know which throw missed.

Derivation: Standard error of a difference
  1. Let X̄₁ and X̄₂ be means of independent samples, sizes n₁ and n₂, SDs σ₁ and σ₂.

  2. Var(X̄ᵢ) = σᵢ²/nᵢ, because averaging n independent runs divides the variance by n.

  3. For independent random variables, Var(X̄₁ − X̄₂) = Var(X̄₁) + Var(X̄₂): the minus sign does not cancel variance.

  4. So SE_diff = √(σ₁²/n₁ + σ₂²/n₂), estimated with sample SDs s₁, s₂.

  5. 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.

  6. 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₂.

7.Practice on your own

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

Practice 2 · a fresh version every time

A large-sample experiment gives mean settling time = 3 s, s = 0.2 s, n = 36. Using z = 1.96, what is the LOWER bound of the 95% confidence interval for the mean, in s?

s

Practice 3 · a fresh version every time

You run n = 36 trials and measure grasp force error. The sample standard deviation is s = 0.3 N. What is the standard error of the mean, in N?

N

Practice 4

Which interpretation of a 95% CI is correct?

Practice 5

Error bars labelled 'SD' on 100 runs. Compared with SE bars they are…

Practice 6

Paired design: per-seed differences have SD 0.12 s over 16 seeds. SE of the mean difference?

s

8.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.

9.Reflect

Concepts: Statistical inference: intervals, effect sizes and p-values · Measurement error and uncertainty · Comparing conditions with uncertainty