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 type | Rejection region | ||
|---|---|---|---|
| Two-tailed | both tails | ||
| Right-tailed | right tail | ||
| Left-tailed | left 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 | Correct | Type 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
- For fixed , decreasing increases (and vice versa).
- Increasing decreases both.
- 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
| Situation | Statistic | Distribution under |
|---|---|---|
| known (or ) | ||
| unknown, normal population |
3. Critical Value Approach
Procedure
- State and .
- Choose the significance level .
- Select the test statistic and determine the critical region (rejection region) from .
- Compute the test statistic from the sample.
- 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 .
- vs
- → critical region
- → reject : evidence that the mean capacity is below 3000 mAh.
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-value | Common 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)
| Situation | Test statistic | df | |
|---|---|---|---|
| ’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 .
| Face | 1 | 2 | 3 | 4 | 5 | 6 | Total |
|---|---|---|---|---|---|---|---|
| 25 | 17 | 15 | 23 | 24 | 16 | 120 | |
| 20 | 20 | 20 | 20 | 20 | 20 | 120 | |
| 1.25 | 0.45 | 1.25 | 0.45 | 0.80 | 0.80 | 5.00 |
, . Since (P-value ), fail to reject: no evidence the die is unfair.
⚠️ 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) | Windows | macOS | Linux | Total |
|---|---|---|---|---|
| Computer Eng. | 40 (35) | 25 (32.5) | 35 (32.5) | 100 |
| Computer Sci. | 30 (35) | 40 (32.5) | 30 (32.5) | 100 |
| Total | 70 | 65 | 65 | 200 |
, . 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