Weighing Evidence • Critical Values• P-Values • Error Types
In Chapter 8, we simply estimated parameters.
Now, the stakes are higher: We are formally testing claims about reality against hard data.
Expect rigorous logic, new terminology (P-values, Alpha, Beta), and structured decision making.
Weighing Evidence
Making Decisions
Managing Errors
Tracking our progression through Inferential Statistics.
In a courtroom, you are "Innocent until proven guilty." Data is the evidence.
$H_0$: You are perfectly Healthy.
Type I Error (False Alarm, $\alpha$): The doctor says you are sick, but you are actually healthy. (Unnecessary stress & meds).
Type II Error (Missed Danger, $\beta$): The doctor says you are healthy, but you are actually sick. (The illness progresses untreated).
When making a statistical decision, there are exactly four possible outcomes:
| Actual Reality (Truth) | ||
|---|---|---|
| Our Decision | $H_0$ is TRUE | $H_0$ is FALSE ($H_a$ True) |
| Do Not Reject $H_0$ | Correct Decision | Type II Error ($\beta$) (Missed a real effect) |
| Reject $H_0$ | Type I Error ($\alpha$) (False alarm) | Correct Decision |
We set a "boundary" based on $\alpha$. If our sample statistic crosses that boundary, we reject the null hypothesis.
Reject if $z \le -z_{\alpha}$
Reject if $z \le -z_{\alpha/2}$ or $z \ge z_{\alpha/2}$
Reject if $z \ge z_{\alpha}$
Assuming $H_0$ is true, the P-Value is the probability of obtaining sample dataat least as inconsistent with $H_0$ as the actual data we observed.
It is the "Observed Significance Level." The smaller the P-value, the stronger the evidence against $H_0$.
Because P-value Area < $\alpha$Area, we Reject $H_0$.
Whether you use the Critical Value or the P-Value, you will always reach the exact same decision.
Compares distances on the x-axis.
Compares areas under the curve.
A dynamic visualization of the Normal Distribution, the critical threshold($\alpha$), and where observed sample data falls to infer population behavior.
| Formal Statistical Step | Plain-English Translator |
|---|---|
| 1State $H_0$ and $H_a$. | What are the opposing claims? |
| 2Choose significance level $\alpha$. | Where is the "bullshit" threshold? |
| 3Compute test statistic(e.g., $z$). | How many standard deviations away is our data from the claim? |
| 4Determine P-value($P$). | What's the probability of seeing this data by pure chance? |
| 5If$P \le \alpha$, reject $H_0$. | Is $P$ lower than $\alpha$? If yes, the Null must go! |
| 6Interpret the result. | State conclusion in context of the original problem. |
If we don't fix $\alpha$, what does the $P$-value itself tell us about the strength of evidence?
| P-Value | Evidence |
|---|---|
| $P > 0.10$ | Weak / None |
| $0.05 < P \le 0.10$ | Moderate |
| $0.01 < P \le 0.05$ | Strong |
| $P \le 0.01$ | Very Strong |
Assumptions: 1) Simple random sample. 2) Normal population OR large sample. 3)Standard Deviation ($\sigma$) is KNOWN.
| Step 1: State hypotheses: $H_0: \mu = \mu_0$ against $H_a$: ($\ne$, $<$, or $>$) Step 2: Choose $\alpha$ Step 3 (Calculate Statistic): $$ z = \frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}} $$ | 4 Determine P-value (via Software or Table II Normal Distribution). 5 Compare $P$ to $\alpha$. 6 Document Conclusion. |
The test logic relies on the Central Limit Theorem. Sample size matters heavily if the underlying biology/process is not normal.
| Sample Size ($n$) | Condition for Use |
|---|---|
| Small ($n < 15$) | Use only if the target variable acts strictly normally. |
| Moderate ($15 \le n < 30$) | Use unless extreme outliers exist or data is heavily skewed. |
| Large ($n \ge 30$) | Can be used essentially without restriction! |
We don't know the population $\sigma$, so we substitute the sample $s$. This adds uncertainty, requiring the "fatter-tailed" student distribution.
Left-tailed $t$-test example where $n=12$($df=11$), testing boundary $\alpha = 0.05$
Two-tailed $t$-test example where $n=25$($df=24$).
Assumptions: 1) Simple random sample. 2) Normal pop OR large sample. 3)Standard Deviation ($\sigma$) UNKNOWN.
| Step 1-2: State hypotheses, choose $\alpha$. Step 3 (Calculate Statistic): $$ t = \frac{\bar{x}-\mu_0}{s/\sqrt{n}} $$ | 4 Calculate P-value using Table IV and Degrees of Freedom ($df = n-1$). 5 Compare $P$ to$\alpha$. 6 Document conclusion. |
What if the sample size is small ($n<15$) and the data plot looks completely weird(not normal)?
Instead of analyzing the raw numbers (which are warped), we analyze their order/rank.
Hypothesis: Are weekly food costs$\ne \mu_0=157$?
| Cost ($x$) | $D = x - 157$ | Absolute $|D|$ | Rank of $|D|$ | Signed Rank ($R$) |
|---|---|---|---|---|
| 143 | -14 | 14 | 7 | -7 |
| 138 | -19 | 19 | 9 | -9 |
| 169 | 12 | 12 | 6 | +6 |
| ... | ... | ... | ... | ... |
| 159 | 2 | 2 | 1 | +1 |
Sum the positive ranks to get $W$.Look up P-value in Wilcoxon Table V (or use software!).
Calculating the exact chance that we missed a real change (Type II Error).
Power is the probability of properly rejecting a false null hypothesis:
Power = $1 -\beta$
Crucial Rule:For a fixed significance level, increasing sample size ($n$) vertically pushes up the power curve. Higher $n$ means fewer missed discoveries!
Synthesizing all tools into a single flowchart structure (Figure 9.39).
Writing code that precisely mirrors the math steps on the board.
# --- METHOD A: Using Summary Statistics (Word Problems) ---
sigma <- ? # Known Pop SD
mu_0 <- ? # Null Hypothesis Mean claim
x_bar <- ? # Sample Mean
n <- ? # Sample Size
# --- METHOD B: Using Raw Data (Uncomment if needed) ---
# data <- c(...)
# x_bar <- mean(data)
# n <- length(data)
# 1. Compute Z-Statistic
z <- (x_bar - mu_0) / (sigma / sqrt(n))
# 2. Compute P-values
p_left <- pnorm(z) # Left-tailed (Ha: mu < mu0)
p_right <- 1 - pnorm(z) # Right-tailed (Ha: mu > mu0)
p_two <- 2 * (1 - pnorm(abs(z))) # Two-tailed (Ha: mu != mu0)
# Output results
z
p_two # (or p_left/p_right depending on your Ha)When $\sigma$ is unknown, we use $s$ and the $t$-distribution.
# --- METHOD A: Using Summary Statistics (Word Problems) ---
s <- ? # Sample SD (Sigma unknown)
mu_0 <- ? # Null Hypothesis Mean claim
x_bar <- ? # Sample Mean
n <- ? # Sample Size
df <- n - 1 # Degrees of Freedom
# --- METHOD B: Using Raw Data (Uncomment if needed) ---
# data <- c(...)
# x_bar <- mean(data)
# s <- sd(data)
# n <- length(data)
# df <- n - 1
# 1. Compute T-Statistic
t_stat <- (x_bar - mu_0) / (s / sqrt(n))
# 2. Compute P-values
p_left <- pt(t_stat, df) # Left-tailed (Ha: mu < mu0)
p_right <- 1 - pt(t_stat, df) # Right-tailed (Ha: mu > mu0)
p_two <- 2 * (1 - pt(abs(t_stat), df)) # Two-tailed (Ha: mu != mu0)
# Output results
t_stat
p_two # (or p_left/p_right depending on your Ha)Based on Figure 9.30 & 9.36 logic: manipulate the Sample Size parameter to see the orange $\beta$ Type II Error region change shape against the Null mean.