1. Statistical Hypotheses

Definition — Statistical Hypothesis

A statistical hypothesis is a claim about one or more populations, usually about a parameter (e.g. "").

Definition — Null and Alternative Hypotheses

  • Null hypothesis : the status quo / claim to be tested; always contains equality (e.g. ).
  • Alternative hypothesis : what we conclude if the data contradict .
Test typeRejection region
Two-tailedboth tails
Right-tailedright tail
Left-tailedleft tail

⚠️ The conclusion is either “reject ” or “fail to reject ”. Failing to reject does not prove true; it means the evidence against it is insufficient. (Like a court: “not guilty” ≠ “innocent”.)

Definition — Type I and Type II Errors

true false
Reject Type I error (prob. )Correct (power )
Fail to reject CorrectType II error (prob. )
  • — the level of significance, chosen in advance (typically 0.05 or 0.01).
  • ; it depends on the true parameter value.
  • Power .

Properties

  1. For fixed , decreasing increases (and vice versa).
  2. Increasing decreases both.
  3. is smaller when the true value is farther from .

2. The Test Statistic

Definition — Test Statistic

A statistic whose distribution is known when is true, used to decide between and . Typical form:

Tests Concerning a Single Mean

SituationStatisticDistribution under
known (or )
unknown, normal population

3. Critical Value Approach

Procedure

  1. State and .
  2. Choose the significance level .
  3. Select the test statistic and determine the critical region (rejection region) from .
  4. Compute the test statistic from the sample.
  5. Reject if the statistic falls in the critical region; otherwise fail to reject.
Reject if ( test)
or

Worked Example — Left-Tailed Test

A manufacturer claims battery capacity mAh with . A test of batteries gives . Is the capacity lower than claimed? Use .

  1. vs
  2. → critical region
  3. → reject : evidence that the mean capacity is below 3000 mAh.
Left-tailed z test, α = 0.05: rejection region z < −1.645; observed z = −2.11 z = −2.11 -3 -1.645 0 1 2 3

Worked Example — Computing and Power

In the battery test, we reject when . If the true mean is :

Power : an 84% chance of detecting a 50 mAh shortfall.


4. P-Value Approach

Definition — P-Value

The P-value is the probability, computed assuming is true, of obtaining a test statistic at least as extreme (in the direction of ) as the one observed. It is the smallest at which would be rejected.

P-value

Decision: reject if P-value .

Worked Examples

  • Battery test: P-value → reject (same as before, but now we also know the strength of evidence).
  • Two-tailed test (bottles from Chapter 12): is the mean fill 12.0? , , .

    Fail to reject : the data are consistent with .
  • Single proportion: vs ; of .

    Reject at (but not at ).
P-valueCommon interpretation
little or no evidence against
– weak evidence
– moderate evidence
strong evidence

⚠️ The P-value is not . It is a probability about the data, computed assuming .

⚠️ For proportion tests, the standard error uses (the hypothesized value), not — unlike the confidence interval.


5. Relationship to Confidence Intervals

Theorem — Duality of Tests and CIs

A two-tailed test of at level rejects exactly when lies outside the confidence interval for .

Proof ( case). We fail to reject iff , which rearranges to — i.e. is inside the CI.

Example. The 95% CI for the bottle mean was . It contains 12.0 → the two-tailed test fails to reject ✓. It does not contain 12.3 → a test of would reject.

One-sided tests correspond to one-sided confidence bounds in the same way.

Two-Sample Tests (same logic, statistics from Chapter 13)

SituationTest statisticdf
’s known–
equal unknown
unequal unknown Welch
paired
large –
large ‘s, –

Example (paired, Chapter 13 laptops). vs : , ; P-value → the new driver significantly improves battery life.


6. Chi-Squared Goodness-of-Fit Test

Definition — Goodness-of-Fit Test

Tests whether observed frequencies in categories agree with the frequencies expected under a hypothesized distribution.

Theorem — Test Statistic


where = observed and = expected frequency in cell . Under , is approximately with

Reject if (always a right-tailed test: large discrepancies → large ).

Worked Example — Is the Die Fair?

A die is rolled 120 times. : each face has probability , so .

Face123456Total
251715232416120
202020202020120
1.250.451.250.450.800.805.00

, . Since (P-value ), fail to reject: no evidence the die is unfair.

χ² with v = 5: rejection region χ² > 11.07 (α = 0.05); observed χ² = 5.00 χ² = 5.00 11.07 0 5 10 15

⚠️ Each expected frequency should be at least 5; combine adjacent cells if needed (and reduce accordingly).

⚠️ If you estimate parameters from the data (e.g. the Poisson mean before computing ), subtract one degree of freedom per estimated parameter.


7. Chi-Squared Test for Independence

Definition — Contingency Table

An table of counts classifying observations by two categorical variables.

Theorem — Test for Independence

: the two variables are independent. Under , the expected count in cell is

and

Why : under independence , estimated by ; multiply by .

Worked Example — Major vs. Preferred OS

200 students, classified by major and preferred operating system ():

Observed (expected)WindowsmacOSLinuxTotal
Computer Eng.40 (35)25 (32.5)35 (32.5)100
Computer Sci.30 (35)40 (32.5)30 (32.5)100
Total706565200


, . Since (P-value ), fail to reject at the 5% level — not enough evidence that OS preference depends on major (though it would be rejected at ).

flowchart TD
    A["State H₀ and H₁"] --> B["Choose α"]
    B --> C["Pick test statistic<br/>(z, t, χ²)"]
    C --> D["Compute it from data"]
    D --> E{"Critical value or P-value?"}
    E -- "Critical value" --> F{"Statistic in<br/>rejection region?"}
    E -- "P-value" --> G{"P-value ≤ α?"}
    F -- Yes --> R["Reject H₀"]
    F -- No --> N["Fail to reject H₀"]
    G -- Yes --> R
    G -- No --> N