01 / 21

One & Two-Sample
Hypothesis Tests

Master the foundations of statistical inference for means and proportions: when to use each test, how to compute test statistics, and how to interpret results for real business decisions.

Business Statistics

What Is Hypothesis Testing?

Hypothesis testing is a formal statistical procedure for deciding whether sample data provide enough evidence to reject a claim about a population parameter. You start with two competing statements:

\(H_0\): Null Hypothesis
The "status quo" claim. Assumes no effect or no difference. We assume this is true until evidence says otherwise.
\(H_a\): Alternative Hypothesis
The research claim. Asserts there is an effect or difference. We need strong evidence to accept this.

The Testing Framework

State
\(H_0\) and \(H_a\)
Choose
\(\alpha\) level
Compute Test Statistic Decide Reject / Fail Reject
\(H_0\)
Reject Fail to Reject
Significance Level \(\alpha\)

One-Sample vs Two-Sample

The number of samples determines which test formula to use. The logic is the same: compare a statistic to a known or estimated standard.

One-Sample
Compare one group to a known or hypothesized value.
Example: "Is our mean delivery time different from 3 days?"
Two-Sample
Compare two independent groups to each other.
Example: "Do customers in Region A spend more than Region B?"

Means vs Proportions

Within each sample type, your test statistic formula depends on whether you are testing a mean (\(\mu\)) or a proportion (\(p\)):

Testing a Mean
Data is quantitative (continuous). Use when measuring averages: revenue, weight, time, scores.
Testing a Proportion
Data is categorical (yes/no). Use when measuring rates: defect rate, conversion rate, approval percentage.

One-Sample Test Statistics

One-Sample \(z\)-test for \(\mu\)
$$z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$$

Use when \(\sigma\) is known

One-Sample \(t\)-test for \(\mu\)
$$t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}$$

Use when \(\sigma\) is unknown, \(df = n-1\)

One-Sample \(z\)-test for \(p\)
$$z = \frac{\hat{p} - p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}}$$

Use for proportions; \(np_0 \ge 10\) and \(n(1-p_0) \ge 10\)

Two-Sample Test Statistics

Two-Sample \(t\)-test for \(\mu_1 - \mu_2\)
$$t = \frac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}$$

Welch's \(t\)-test (unequal variances assumed)

Two-Sample \(z\)-test for \(p_1 - p_2\)
$$z = \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1-\hat{p})\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}$$

Where \(\hat{p} = \frac{x_1+x_2}{n_1+n_2}\) is the pooled proportion

\(z\)-test vs \(t\)-test

\(z\)-test \(t\)-test
Population \(\sigma\) Known Unknown
Estimate of spread \(\sigma\) \(s\) (sample std dev)
Distribution Standard Normal Student's \(t\) with \(df\)
When to use for means Large \(n\) or \(\sigma\) known Small \(n\), \(\sigma\) unknown
Proportions Always \(z\) Not used

One-Tailed vs Two-Tailed Tests

Left-Tailed
\(H_a: \mu < \mu_0\)
Rejection region on the left.
"Is the mean less than the target?"
Two-Tailed
\(H_a: \mu \neq \mu_0\)
Rejection region on both sides.
"Is the mean different from the target?"
Right-Tailed
\(H_a: \mu > \mu_0\)
Rejection region on the right.
"Is the mean greater than the target?"

Step-by-Step Procedure

1
State hypotheses. Write \(H_0\) and \(H_a\) using the parameter (\(\mu\) or \(p\)).
2
Choose \(\alpha\). Typically \(\alpha = 0.05\). Decide one-tailed or two-tailed.
3
Check conditions. Random sample, independence, normality or large \(n\), and \(np \ge 10\) for proportions.
4
Compute the test statistic. Use the appropriate \(z\) or \(t\) formula.
5
Find the \(p\)-value (or compare to critical value). The \(p\)-value is the probability of observing a result this extreme if \(H_0\) is true.
6
Make a decision. If \(p\)-value \(\le \alpha\), reject \(H_0\). Otherwise, fail to reject.

Example 1: One-Sample \(t\)-test

1
Hypotheses: \(H_0: \mu = 4\), \(H_a: \mu > 4\) (right-tailed)
2
Test statistic: \(t = \frac{4.5 - 4}{1.2 / \sqrt{36}} = \frac{0.5}{0.2} = 2.5\)
3
Degrees of freedom: \(df = 36 - 1 = 35\)
4
\(p\)-value: \(P(t > 2.5)\) with \(df = 35\) is approximately 0.0087
5
Decision: Since \(0.0087 < 0.05\), we reject \(H_0\). Evidence suggests mean order time exceeds 4 minutes.

Example 2: One-Sample \(z\)-test for \(p\)

1
Hypotheses: \(H_0: p = 0.05\), \(H_a: p > 0.05\) (right-tailed)
2
Check conditions: \(np_0 = 200(0.05) = 10\) ✓ and \(n(1-p_0) = 190\) ✓
3
Standard error: \(SE = \sqrt{\frac{0.05 \times 0.95}{200}} = \sqrt{0.0002375} \approx 0.0154\)
4
Test statistic: \(z = \frac{0.08 - 0.05}{0.0154} \approx 1.95\)
5
\(p\)-value: \(P(Z > 1.95) \approx 0.0256\). Since \(0.0256 < 0.05\), reject \(H_0\).

Example 3: Two-Sample \(t\)-test

1
Hypotheses: \(H_0: \mu_1 - \mu_2 = 0\), \(H_a: \mu_1 - \mu_2 \neq 0\) (two-tailed)
2
Standard error: \(SE = \sqrt{\frac{8^2}{40} + \frac{10^2}{45}} = \sqrt{1.6 + 2.222} = \sqrt{3.822} \approx 1.955\)
3
Test statistic: \(t = \frac{52 - 48}{1.955} \approx 2.046\)
4
Approximate \(p\)-value: With \(df \approx 79\) (Welch's), two-tailed \(p\)-value \(\approx 0.044\)
5
Decision: \(0.044 < 0.05\): reject \(H_0\). There is a significant difference in mean spending.

Interpreting the \(p\)-value

\(p\)-value
test stat Small \(p\)-value
Reject \(H_0\)
Large \(p\)-value
Fail to Reject \(H_0\)
Distribution under \(H_0\)

Common Mistakes to Avoid

✕ "Accept \(H_0\)"
We never "accept" the null. We fail to reject it. Absence of evidence is not evidence of absence.
✕ Wrong Tail
Using a two-tailed test when the research question is directional (or vice versa) changes the \(p\)-value and can flip your conclusion.
✕ Ignoring Conditions
Forgetting to check \(np \ge 10\) for proportions or normality for small-sample means invalidates the test.
✕ Using \(z\) When \(\sigma\) Is Unknown
If you estimate \(\sigma\) with \(s\), you must use the \(t\)-distribution. Using \(z\) underestimates uncertainty.
✕ Pooling When Inappropriate
For two-sample proportion tests, pool under \(H_0\). For means, do not pool standard deviations unless equal-variance assumption is justified.

Summary of All Tests

Test Parameter Statistic Key Formula
1-sample \(z\) (mean) \(\mu\) \(z\) $$\frac{\bar{x}-\mu_0}{\sigma / \sqrt{n}}$$
1-sample \(t\) (mean) \(\mu\) \(t\) $$\frac{\bar{x}-\mu_0}{s / \sqrt{n}}$$
1-sample \(z\) (proportion) \(p\) \(z\) $$\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$$
2-sample \(t\) (means) \(\mu_1-\mu_2\) \(t\) $$\frac{\bar{x}_1-\bar{x}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$
2-sample \(z\) (proportions) \(p_1-p_2\) \(z\) $$\frac{\hat{p}_1-\hat{p}_2}{\sqrt{\hat{p}(1-\hat{p})\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}$$

Question 1 of 5

A manager wants to test whether the mean customer satisfaction score has changed from 75. She collects a sample and does not know the population standard deviation. Which test should she use?

Question 2 of 5

For a one-sample \(z\)-test for proportions, which condition must be satisfied for the test to be valid?

Question 3 of 5

A sample of \(n = 50\) yields \(\bar{x} = 102\) with \(s = 10\). Testing \(H_0: \mu = 100\) vs \(H_a: \mu > 100\), what is the test statistic?

Question 4 of 5

In a two-sample \(z\)-test for proportions, the pooled proportion \(\hat{p}\) is used in the standard error. Why do we pool?

Question 5 of 5

A researcher finds a \(p\)-value of 0.03 when testing at \(\alpha = 0.05\). Which conclusion is correct?