PROJECTENGRAM

HYPOTHESIS TESTING

Tags: #◇Computer Science #◇STT101A #◇Conceptual #◇Hypothesis Testing #◇Statistics #◇Probability


◇Overview

Hypothesis testing is the cornerstone of inferential statistics. It provides a formal, objective mathematical framework for determining whether experimental or sample data provides sufficient empirical evidence to reject a baseline assertion (the null hypothesis) in favor of a competing claim (the alternative hypothesis).

◇Key Definitions

  • Null Hypothesis (H0H_0): The default presumption of no effect, no difference, or status quo: H0:θ=θ0H_0: \theta = \theta_0.
  • Alternative Hypothesis (H1H_1 or HaH_a): The research claim or hypothesis indicating that an effect, disparity, or change exists:
    • Two-tailed: Ha:θ≠θ0H_a: \theta \ne \theta_0
    • Right-tailed (upper): Ha:θ>θ0H_a: \theta > \theta_0
    • Left-tailed (lower): Ha:θ<θ0H_a: \theta < \theta_0
  • Test Statistic: A sample-derived standardized random variable (ZZ, tt, χ2\chi^2, or FF) quantifying the discrepancy between the sample observation and the null hypothesis parameter.
  • Significance Level (α\alpha): The maximum permissible threshold probability of committing a Type I error: α=P(Reject H0∣H0 is true)\alpha = P(\text{Reject } H_0 \mid H_0 \text{ is true}). Typically set to 0.050.05, 0.010.01, or 0.0010.001.
  • pp-Value (Probability Value): The exact probability, computed assuming H0H_0 is true, of obtaining a test statistic at least as extreme as the observed sample value.
    • Decision Rule: If p≤αp \le \alpha, reject H0H_0 (statistically significant).
    • If p>αp > \alpha, fail to reject H0H_0 (insufficient evidence).
  • Critical Region (Rejection Region): The set of test statistic values for which the null hypothesis is rejected.
  • Statistical Power (1−β1 - \beta): The probability of correctly rejecting a false null hypothesis: P(Reject H0∣H0 is false)P(\text{Reject } H_0 \mid H_0 \text{ is false}).

◇Theoretical Framework: Error Classification Matrix

In any statistical hypothesis test, two distinct error states can occur:

Statistical Decision \ Truth of NatureH0H_0 is Actually TrueH0H_0 is Actually False
Reject H0H_0Type I Error (α\alpha)
(False Alarm / Producer's Risk)
Correct Decision (1−β1 - \beta)
(Statistical Power)
Fail to Reject H0H_0Correct Decision (1−α1 - \alpha)
(Confidence Level)
Type II Error (β\beta)
(Miss / Consumer's Risk)

Test Statistic Selection Heuristic


◇Stepped Numerical Walkthrough: Two-Tailed ZZ-Test

Scenario: A cloud infrastructure engineer tests the round-trip latency of a modified database cluster. Under the default configuration, latency has a mean of μ0=250 ms\mu_0 = 250\text{ ms} with a known population standard deviation σ=32 ms\sigma = 32\text{ ms}. A random sample of n=64n = 64 query responses under heavy load yields a sample mean latency of xˉ=258 ms\bar{x} = 258\text{ ms}. Test at the α=0.05\alpha = 0.05 significance level whether the true mean latency has changed.

Step 1: Formulate Hypotheses

H0:μ=250 ms(No change in latency)H_0: \mu = 250\text{ ms} \quad (\text{No change in latency})
Ha:μ≠250 ms(Two-tailed test: latency differs)H_a: \mu \ne 250\text{ ms} \quad (\text{Two-tailed test: latency differs})

Step 2: Establish Significance Level & Critical Values

Given α=0.05\alpha = 0.05 for a two-tailed test, the significance area is split equally into both tails: α/2=0.025\alpha / 2 = 0.025.
From the standard normal cumulative table (Z∼N(0,1)Z \sim \mathcal{N}(0, 1)):
zα/2=z0.025=1.960z_{\alpha/2} = z_{0.025} = 1.960
Rejection Region: Reject H0H_0 if Zcalc>1.960Z_{\text{calc}} > 1.960 or Zcalc<−1.960Z_{\text{calc}} < -1.960 (i.e., ∣Zcalc∣>1.960|Z_{\text{calc}}| > 1.960).

Step 3: Compute Standard Error & Test Statistic

Standard Error of the Mean:
σxˉ=σn=3264=328=4.0 ms\sigma_{\bar{x}} = \frac{\sigma}{\sqrt{n}} = \frac{32}{\sqrt{64}} = \frac{32}{8} = 4.0\text{ ms}
Standardized Test Statistic (ZcalcZ_{\text{calc}}):
Zcalc=xˉ−μ0σxˉ=258−2504.0=84.0=+2.00Z_{\text{calc}} = \frac{\bar{x} - \mu_0}{\sigma_{\bar{x}}} = \frac{258 - 250}{4.0} = \frac{8}{4.0} = \mathbf{+2.00}

Step 4: Compute the Exact pp-Value

For a two-tailed test:
p=2⋅P(Z≥∣Zcalc∣)=2⋅P(Z≥2.00)p = 2 \cdot P(Z \ge |Z_{\text{calc}}|) = 2 \cdot P(Z \ge 2.00)
Using the standard normal CDF: P(Z<2.00)=0.97725P(Z < 2.00) = 0.97725, so P(Z≥2.00)=1−0.97725=0.02275P(Z \ge 2.00) = 1 - 0.97725 = 0.02275.
p=2×0.02275=0.0455p = 2 \times 0.02275 = \mathbf{0.0455}

Step 5: Statistical & Practical Conclusion

  • Comparison: p=0.0455≤α=0.05p = 0.0455 \le \alpha = 0.05, and ∣Zcalc∣=2.00>1.960|Z_{\text{calc}}| = 2.00 > 1.960.
  • Formal Decision: Reject H0H_0 at the 5%5\% significance level.
  • Engineering Conclusion: There is sufficient empirical evidence to conclude that the database modification resulted in a statistically significant change in mean query response time.

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Which probability represents a Type I error (α\alpha)?

Q2

What is the statistical power of a hypothesis test?

Q3

If a test produces a pp-value of 0.0180.018 and the chosen significance level is α=0.05\alpha = 0.05, what is the correct statistical decision?

Q4

What distinguishes a tt-test from a zz-test when testing a single population mean?

Q5

When performing a two-tailed test with α=0.01\alpha = 0.01, what is the tail probability in each rejection region?

Q6

Why do statisticians state "fail to reject H0H_0" rather than "accept H0H_0"?

Q7

How does increasing the sample size nn affect the standard error and test sensitivity, holding variance constant?

Q8

In our worked latency example with Z=2.00Z = 2.00, what would the conclusion have been if the test had been set at α=0.01\alpha = 0.01 (zcrit=±2.576z_{\text{crit}} = \pm 2.576)?

Q9

What is the degrees of freedom (dfdf) for a single-sample tt-test with sample size n=25n = 25?

Q10

If the null hypothesis is rejected at α=0.01\alpha = 0.01, what is guaranteed about its outcome at α=0.05\alpha = 0.05?