Confidence Interval Stepper

The learner types the summary data (x-bar with sigma or s, or x successes out of n), picks the formula, level and sides, and steps through assumptions, estimate, standard error, critical value (with the R call), margin and the interval drawn on a number line, then the interpretation. A test mode steps a one-sample z-mean, t-mean or z-proportion test the same way, ending with the p-value shaded under N(0,1) or t, the decision and the conclusion in context; a choose mode asks which formula fits each scenario.

Used in: Introduction to Statistics

Props

PropTypeDefaultDescription
titlestring—Title bar text. Default: "Confidence interval, step by step" (test: "Hypothesis test, step by step"; choose: "Which confidence interval?").
procedurestring"interval"interval (confidence interval or one-sided bound) or test (one-sample hypothesis test with the p-value approach).
formulastring"z-mean"z-mean (sigma known; with s and no sigma: large-sample z with s), t-mean (sigma unknown, t with n - 1 df), z-proportion, general (estimate and SE typed directly, or a given interval), or choose (the learner picks the formula for each of the scenarios).
xbarnumber—Sample mean for z-mean / t-mean. Default 50 (test: 51.8 for z, 520 for t).
sigmanumber—Known population standard deviation (z-mean). Default 12 (test: 2.5).
snumber—Sample standard deviation (t-mean; or z-mean when sigma is not given, the large-sample case). Default 11 (test: 40).
nnumber—Sample size. Default 36 (z-mean), 9 (t-mean), 270 (z-proportion).
xnumber—Number of successes for z-proportion (p-hat = x/n). Default 7 (test: 46).
phatnumber—Sample proportion, used for z-proportion when x is not given.
estimatenumber50Point estimate for the general form.
senumber2Standard error for the general form.
intervalnumber[]—General form only: a given two-sided interval [L, U]; the steps recover the estimate (midpoint), the margin of error (U - L)/2 and the implied SE.
mu0number—Test mode: null value of the mean (H_0: mu = mu0). Default 50 for the z default data, 500 for t, else a value about 1.5 SE below x-bar.
p0number—Test mode: null value of the proportion (H_0: p = p0). Default 0.18 for the default data.
levelnumber0.95Confidence level (0.95, or 95).
levelChoicesnumber[][0.9, 0.95, 0.99]Levels offered in the level toggle (level is added if missing); one value hides the toggle.
alphanumber0.05Test mode: significance level.
alphaChoicesnumber[][0.1, 0.05, 0.01]Test mode: significance levels offered in the toggle; one value hides it.
sidesstring"two"Interval: two (two-sided), lower (lower bound, mu > L) or upper (upper bound, mu < U). Test: two (H_1: !=), upper (H_1: >) or lower (H_1: <).
sideChoicesstring[]["two", "lower", "upper"]Sides the learner can switch between (values as in sides); [] or one value hides the toggle.
formulaChoicesstring[]["z-mean", "t-mean", "z-proportion"]Formulas offered in the formula menu (general is added when formula is general); one value locks the formula.
procedureTogglebooleanfalseShow an Interval / Test switch in the title bar.
stepsbooleantrueReveal the work one step at a time (Back / Next step / Show all). false shows every step at once.
stepnumber0Steps already revealed when the page loads: 0 shows the setup without the answer; a large number shows everything.
editablebooleantrueLet the learner type the data. false shows the values as fixed chips (a worked example).
normalPopulationbooleanfalseThe population is stated to be (approximately) normal, so the assumptions step passes for n < 30.
contextstring—The parameter in words for the interpretation and conclusion, e.g. "the true mean fill" (inline TeX in $...$ allowed). Default "the population mean $\mu$" / "the population proportion $p$".
unitsstring—Units appended to values in the interpretation, the conclusion and the number-line label (e.g. "ml", "cm/s").
showRbooleantrueShow the R call (qnorm, qt, pnorm, pt) that computes each critical value and p-value.
digitsnumber—Decimal places shown (trailing zeros trimmed). Default 4, or 5 for proportions. Critical values always show 3.
scenariosarray—Choose mode: situations to classify, as strings ("sigma known, n = 40", "sigma unknown, n = 8, normal", "yes/no data, n = 200"; the answer is inferred) or {label, answer: z-mean | t-mean | z-proportion, note?}.
controlsstring[]all controls shownRegistry ids of the hideable toggles, menu entries and readouts to show (e.g. toggle.sides, formula.t-mean, formula.z-proportion, readout.r-code, procedure.toggle, toggle.alpha, toggle.alternative, readout.critical-lines). Core controls always show; absent shows everything. Fitted by tooling from the props and what the lecture has taught; authors do not pick it by hand.