Hybrid· RSelf-learningHomeworkPredict, observe, explainRecall with feedbackBefore teachingAccessibility not checkedPublished
Catch the Mean: confidence intervals for a mean in R
By Alexis Diamond · Statistics · Confidence Intervals · Undergraduate · Computational / statistical · version 8
Licence: CC BY 4.0
Topicsconfidence intervalsstandard errort critical valuet distributionconfidence level and widthr programming
Assumption ledger (5)
- dataThe coffee-shop sample (n = 64, x̄ = 4.6, s = 2.4 minutes) is made up, not real data.
- simplificationStep 1 supposes σ is known, to show where the 95% comes from. Steps 2 to 4 treat σ as unknown, as it almost always is.
- interpretationBecause σ is estimated, two things change, whatever n is: s (dividing by n − 1, as R's sd() does) replaces σ in SE = s ÷ √n, and the multiplier comes from the t-distribution with df = n − 1 = 63, not the normal curve. At df = 63 they are close (1.998 vs 1.96 for 95%), but with σ unknown t is still the one to use.
- distributionThe t interval is exact for independent draws from a normal population. Wait times are usually skewed, so here it is an approximation that relies on the CLT making x̄ close to normal; it improves as n grows. When it holds is left for class.
- parametert = qt(0.975, 63) = 1.9983 for 95% and qt(0.995, 63) = 2.6561 for 99%. With SE = 0.3: half-widths 0.600 and 0.797 minutes; intervals [4.00, 5.20] and [3.80, 5.40]. The step 3 check accepts t99 within 0.01 of qt(0.995, 63). Step 1 uses z = 1.96 (qnorm(0.975)) for the σ-known case.
Checks Breakout ✓ · Code not checked · Accessibility ✓
Breakout check
✓ Ready for breakouts: every control we tried showed teammates the same thing.
Code checks
Not checked yet.
Cite this · History
Cite this
Alexis Diamond (2026). Catch the Mean: confidence intervals for a mean in R [Interactive model], version 8. Ideas at Play. https://ideasatplay.org/play/catch-the-mean-confidence-intervals-for-a-mean-in-r-44afde?v=8 (CC BY 4.0)
History
- v8Ordered answer scales keep their order (data-kc-order="fixed"); other multiple-choice options are now shuffled by the platform. (edited, Dec 2, 2026)current
- v7After independent review: step 1 qnorm note hidden until the reveal; last hints no longer the full line; step 2 two changes as a list; ledger wording; stale JS removed. (edited, Nov 27, 2026)View
- v6Switched steps 2-4 to t: σ unknown, so s (n − 1) and qt(df = 63): 95% t ≈ 1.998, 99% t ≈ 2.656; intervals [4.00, 5.20] and [3.80, 5.40]; ledger updated; reveals self-paced. (edited, Nov 27, 2026)View
- v5Step 1 diagram, after review: the removed tail is orange in the first curve too; 0 tick; clearer caption. (edited, Nov 27, 2026)View
- v4Step 1: a three-panel diagram above the task (area left of 1.96 − area left of −1.96 = the middle), visible before any code is run. (edited, Nov 27, 2026)View
- v3Ends after step 4: removed the [12, 86] pre-class steps and Check yourself (exit, calibration, return check). (edited, Nov 25, 2026)View
- v2σ named explicitly as the population standard deviation (usually unknown), which the sample's SD s stands in for. (edited, Nov 25, 2026)View
- v1Imported; lineage before import is not available. (imported, Nov 24, 2026)View
Comments
No comments yet.
Sign in to comment or like.