Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1Which method do I use?

By Week 13 you know two families of inference — one proportion and one mean — and two things you can do with each — build a confidence interval, or run a hypothesis test. That is four total procedures. The hard part is rarely the arithmetic; it’s picking the right one of the four from a paragraph of English. This guide walks you there in a few short questions, and points you to the matching formula, calculator menu, and R function every time.


1.11. The decision tree

Is the variable categorical (yes/no, success/failure) or numerical (a measured amount)?
│
├── CATEGORICAL → you are estimating or testing a PROPORTION (p)
│     │
│     ├── Does the question ask "what's a plausible range for p?"
│     │     → CONFIDENCE INTERVAL for one proportion
│     │       TI: 1-PropZInt   |   R: prop.test(x, n)$conf.int
│     │
│     └── Does the question give a specific claimed value p0 to check?
│           ("is it 90%?" "test the claim that...")
│           → HYPOTHESIS TEST for one proportion
│             TI: 1-PropZTest   |   R: prop.test(x, n, p = p0, alternative = ...)
│
└── NUMERICAL → you are estimating or testing a MEAN (μ)
      │
      ├── Does the question ask "what's a plausible range for μ?"
      │     → CONFIDENCE INTERVAL for one mean
      │       TI: TInterval   |   R: t.test(~y, data=, mu=) or tsum.test(...)$conf.int
      │
      └── Does the question give a specific claimed value μ0 to check?
            ("is the true mean 25?" "test the claim that...")
            → HYPOTHESIS TEST for one mean
              TI: T-Test   |   R: t.test(~y, data=, mu = μ0) or tsum.test(..., mu = μ0)

Reading a problem for its variable type (categorical → proportion; numerical → mean) and its verb (estimate/plausible range → interval; test/claim/is it true that → hypothesis test) is the whole procedure. Everything below fills in the details of each branch.


1.22. The master decision table

Response typeGoalProcedureTI-83/84R (mosaic/BSDA)Chapter
Categorical (one proportion)EstimateOne-proportion z-interval1-PropZIntprop.test(x, n)$conf.intCh 6
Categorical (one proportion)Test a claimOne-proportion z-test1-PropZTestprop.test(x, n, p = p0, alternative =)Ch 6
Numerical (one mean, σ\sigma unknown)EstimateOne-mean t-intervalTIntervalt.test(~y, data=) or tsum.test(...)$conf.intCh 7
Numerical (one mean, σ\sigma unknown)Test a claimOne-mean t-testT-Testt.test(~y, data=, mu = μ0) or tsum.test(..., mu = μ0)Ch 7
Numerical (one mean, σ\sigma known, rare)Estimate / testOne-mean z-interval / z-testZInterval / Z-Testzsum.test(...)Ch 5 preview

Data on hand as a full list, or only summary statistics (xˉ\bar{x}, ss, nn)? Either way the choice of procedure above doesn’t change — only which R function you call does. From summary statistics, use the BSDA sum tests (tsum.test(), zsum.test()); with raw data loaded in R, use t.test(). See the R Quick Reference.


1.33. Confidence interval or hypothesis test — which does the question want?

Clue words in the problemYou want
“estimate,” “plausible range,” “how big is,” “construct a ___% interval for”confidence interval
“test the claim,” “is it true that,” “has changed,” “is different from,” a stated α\alpha or significance levelhypothesis test

Every procedure above reports both when you run it in R — prop.test(), t.test(), and the BSDA *sum.test() functions each print a test decision and a confidence interval in the same call, so you don’t lose anything by running one when the question technically asked for the other. On the calculator, though, you must choose the matching menu item (Int vs. Test) yourself.


1.44. Before you trust any result — check the conditions

Every procedure in this course assumes something about how the data were collected. Skipping the check doesn’t break the arithmetic, but it does break the guarantee behind “95% confident” or the p-value.

ProcedureConditions to check
One-proportion interval / testIndependence (random sample, or random assignment; each observation doesn’t affect another) and success–failure: interval needs np^≥10n\hat p \ge 10 and n(1−p^)≥10n(1-\hat p) \ge 10; test needs np0≥10np_0 \ge 10 and n(1−p0)≥10n(1-p_0) \ge 10
One-mean interval / test (t)Independence (random sample) and the population is approximately Normal, or the sample size is large enough (n≥30n \ge 30 is the common rule of thumb) that the Central Limit Theorem covers you regardless of the population’s shape

If a condition fails — say, np^<10n\hat p < 10, or a small, clearly skewed sample — the Normal/t-based procedure above may give a misleading interval or p-value. Say so in your conclusion rather than reporting a number you don’t trust; your instructor would rather see “the success–failure condition fails here, so this z-interval should be interpreted with caution” than a silently invalid answer.


1.55. Worked routing examples