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
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Title bar text. Default: "Confidence interval, step by step" (test: "Hypothesis test, step by step"; choose: "Which confidence interval?"). |
| procedure | string | "interval" | interval (confidence interval or one-sided bound) or test (one-sample hypothesis test with the p-value approach). |
| formula | string | "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). |
| xbar | number | — | Sample mean for z-mean / t-mean. Default 50 (test: 51.8 for z, 520 for t). |
| sigma | number | — | Known population standard deviation (z-mean). Default 12 (test: 2.5). |
| s | number | — | Sample standard deviation (t-mean; or z-mean when sigma is not given, the large-sample case). Default 11 (test: 40). |
| n | number | — | Sample size. Default 36 (z-mean), 9 (t-mean), 270 (z-proportion). |
| x | number | — | Number of successes for z-proportion (p-hat = x/n). Default 7 (test: 46). |
| phat | number | — | Sample proportion, used for z-proportion when x is not given. |
| estimate | number | 50 | Point estimate for the general form. |
| se | number | 2 | Standard error for the general form. |
| interval | number[] | — | 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. |
| mu0 | number | — | 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. |
| p0 | number | — | Test mode: null value of the proportion (H_0: p = p0). Default 0.18 for the default data. |
| level | number | 0.95 | Confidence level (0.95, or 95). |
| levelChoices | number[] | [0.9, 0.95, 0.99] | Levels offered in the level toggle (level is added if missing); one value hides the toggle. |
| alpha | number | 0.05 | Test mode: significance level. |
| alphaChoices | number[] | [0.1, 0.05, 0.01] | Test mode: significance levels offered in the toggle; one value hides it. |
| sides | string | "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: <). |
| sideChoices | string[] | ["two", "lower", "upper"] | Sides the learner can switch between (values as in sides); [] or one value hides the toggle. |
| formulaChoices | string[] | ["z-mean", "t-mean", "z-proportion"] | Formulas offered in the formula menu (general is added when formula is general); one value locks the formula. |
| procedureToggle | boolean | false | Show an Interval / Test switch in the title bar. |
| steps | boolean | true | Reveal the work one step at a time (Back / Next step / Show all). false shows every step at once. |
| step | number | 0 | Steps already revealed when the page loads: 0 shows the setup without the answer; a large number shows everything. |
| editable | boolean | true | Let the learner type the data. false shows the values as fixed chips (a worked example). |
| normalPopulation | boolean | false | The population is stated to be (approximately) normal, so the assumptions step passes for n < 30. |
| context | string | — | 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$". |
| units | string | — | Units appended to values in the interpretation, the conclusion and the number-line label (e.g. "ml", "cm/s"). |
| showR | boolean | true | Show the R call (qnorm, qt, pnorm, pt) that computes each critical value and p-value. |
| digits | number | — | Decimal places shown (trailing zeros trimmed). Default 4, or 5 for proportions. Critical values always show 3. |
| scenarios | array | — | 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?}. |
| controls | string[] | all controls shown | Registry 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. |