Tests for Normal Means (z-test and t-test)

Context: FIT2086_MOC Β· the case selection layer of Hypothesis Testing β€” one sample or two, known or estimated Β· same four-way split as Confidence Intervals, because each test statistic is the CI’s pivot re-centred on the null Β· critical values from Student-t Distribution

Quick Revision

  • 🎯 Objective: identify (samples, status, ) βž” pick the statistic βž” read the tail of or βž” grade the evidence.
  • πŸ“¦ Core Components: known βž” | unknown & normal βž” | unknown & βž” approximate | two samples βž” variances add.
  • ⚑ Key Constraint: every statistic is β€” the only thing that changes across cases is which standard error and which reference distribution.

πŸ“ Core

  • Universal shape βž” ; the case table below is entirely a table of standard errors and reference distributions.
  • Unknown variance costs a distribution βž” substituting the unbiased makes the denominator random too, so the statistic follows , not .
  • Large buys back normality βž” for from any distribution the CLT makes approximately normal and nearly exact, so the form returns as an approximation.
  • Two samples, one difference βž” is restated as , so the estimate under test is with null mean zero.
  • Independence makes variances add βž” under the null; the minus sign never reaches the variance.
  • Direction is a relabelling βž” testing is identical to testing , so only one one-sided formula is needed.
  • Exact two-sample procedures exist βž” more precise but more complicated methods handle unknown, unequal variances; t.test() implements several βž” R Toolkit (Cheatsheet).

βš–οΈ Case Selection Matrix

CaseAssumptionsTest statisticNull distribution
1. One sample, knownnormal population (any ), or from any distribution; independent exact
2. One sample, unknown, normal population; independent exact
3. One sample, unknown, any distribution; independent approximate
4. Two samples, knownboth normal (any ), or ; independent exact
5. Two samples, unknown, large , any distribution; independent approximate

-value from any of the above βž” substitute the statistic and its reference RV ( or ) into the three-way rule of Hypothesis Testing: two-sided Β· upper Β· lower .

When It Flips: Case 1 becomes Case 2 the instant is computed from the same data, and always ⟹ the honest is the larger one. Case 2 relaxes into Case 3 around , where makes the choice immaterial.

πŸ”­ Beyond the lecture (flagged β€œoptional extra” on the slides β€” small- two-sample )

  • Equal variances assumed βž” pool them: , then .
  • Unequal variances (Welch) βž” with the Welch–Satterthwaite .

πŸ“Š Worked Example Bank

Scenario vs InputsStatistic-valueVerdict
Ohm’s law β€” measured voltage vs , , in by chance βž” weak evidence; data not incompatible with Ohm
”Schmidt’s law” β€” same data, vs , , very strong evidence against
Bear weights (Case 1, one-sided lower) vs , , do not reject βž” mean weight not shown to be lb
Algebra scores (Case 1, one-sided upper) vs , , moderate evidence βž” new system improves scores
-test (i) (Case 2, two-sided) vs , , , insufficient evidence to reject
-test (ii) (same data, one-sided) vs as above, moderate evidence βž” reject in favour of
Graduate salaries (Case 4, one-sided) vs ; ; reject βž” men’s mean salary higher
Repair costs (Case 5, two-sided) vs ; ; strong evidence βž” mean repair costs differ
Blood pressure (Case 2, two-sided; Studio 5) vs , , , very strong βž” sample does not come from an β€œat risk” (– mmHg) population
Blood pressure (same data, one-sided lower) vs as above, (exactly half)very strong βž” the stronger claim: the population is healthy, not merely β€œnot at risk”

Final extracted output: the same produces (weak) two-sided and (moderate) one-sided β€” the alternative, not the data, moved the verdict across the conventional threshold. This is why must be fixed before the sample is seen.

Derivation trace β€” the -test example by hand

Final extracted output: and bracket , so the one-sided lies between and β€” consistent with the tabulated and enough to place the evidence as moderate without a computer.

Three routes to one difference β€” S&P 500 pre/post-Lehman (Studio 5)

, , ; , , ; .

RouteStatistic-value CI for
Approximate (Case 5, by hand) βž” narrowest
Welch (var.equal = FALSE, the default)
Pooled (var.equal = TRUE) βž” widest

Final extracted output: all three reach the same verdict β€” the difference of dwarfs its standard error of , so the observed gap is essentially impossible under β€œthe bank collapse and the economy are unassociated”. The intervals are what separate the routes: the approximate is narrowest because it treats as if they were known, so it is slightly overconfident; pooling is widest here because the two variances are in fact quite different ( vs ), so forcing a common variance is the wrong assumption. Do not compare the raw magnitudes across routes β€” has far thinner tails than , so the route reports an absurdly smaller number for the same evidence.

⚠️ Common Mistakes

  • πŸ’‘ Using after estimating at small βž” the reference distribution is , whose tails are heavier, so the tail understates and manufactures evidence β€” the same error that makes a interval undercover.
  • πŸ’‘ Feeding (divisor ) into the -statistic βž” the result is derived for the unbiased with divisor (Estimator Quality (Bias, Variance, MSE)); the ML version shrinks and inflates .
  • πŸ’‘ instead of βž” one degree of freedom is spent estimating inside ; at that is .
  • πŸ’‘ Adding standard deviations for a difference βž” overstates ; add the variances, then take one square root.
  • πŸ’‘ Dividing the two-sample difference by a single βž” each sample contributes its own ; the sample sizes need not be equal.

🧠 Active Recall