Chapter 9
📚 Chapter 9.pdf
Brief overview
This document introduces the core principles and methodologies of hypothesis testing. Understanding these concepts is crucial for drawing statistically valid conclusions from data and making informed decisions in research and analysis.
Key points
- Introduction to the fundamentals of hypothesis testing, including null and alternative hypotheses and error types.
- Conducting hypothesis tests for population means when population standard deviation is known.
- Performing hypothesis tests for population means with unknown population standard deviation using the t-distribution.
- How to conduct hypothesis tests for a population proportion using the standard normal distribution.
- Advanced concepts including decision-making, calculating Type II error probabilities, and sample size determination.
1. Introduction to hypothesis testing
1.1 Developing null and alternative hypotheses
Hypothesis testing uses sample data to decide whether a statement about a population parameter is true.
- Null hypothesis (H0): A tentative assumption about a population parameter. It's the statement being challenged.
- Alternative hypothesis (Ha): A statement that contradicts the null hypothesis. It's often what a researcher hopes to support.
The alternative hypothesis is often the research hypothesis.
1.2 When the alternative hypothesis is the research hypothesis
The researcher forms the alternative hypothesis (Ha) based on what they want to prove. The null hypothesis (H0) is set up as the opposite, often representing the status quo or no effect.
- Example: A new fuel injection system is being tested to see if it improves miles per gallon.
- Ha: The new system increases miles per gallon (μ>24).
- H0: The new system does not increase miles per gallon (μ≤24).
1.3 When the null hypothesis is an assumption to be challenged
The null hypothesis (H0) represents an existing belief or assumption. The alternative hypothesis (Ha) challenges this assumption.
-
Example: A soft drink label claims 67.6 fluid ounces.
- H0: The mean filling weight is at least 67.6 ounces (μ≥67.6). (Manufacturer's perspective, challenging claims if underfilled)
- Ha: The mean filling weight is less than 67.6 ounces (μ<67.6).
-
Example: Manufacturer's quality control for a 67.6-ounce bottle.
- H0: The mean filling weight is equal to 67.6 ounces (μ=67.6). (Process is working correctly)
- Ha: The mean filling weight is not equal to 67.6 ounces (μ=67.6). (Overfilling or underfilling is occurring)
The equality sign (=, ≤, or ≥) always belongs in the null hypothesis (H0).
1.4 Forms of null and alternative hypotheses for a population mean (μ)
There are three possible forms for hypothesis tests concerning a population mean (μ0 is the hypothesized value):
| Null Hypothesis (H0) | Alternative Hypothesis (Ha) | Test Type |
|---|---|---|
| μ≥μ0 | μ<μ0 | Lower Tail |
| μ≤μ0 | μ>μ0 | Upper Tail |
| μ=μ0 | μ=μ0 | Two-Tailed |
1.5 Type I and Type II errors
Hypothesis testing uses sample data, which can lead to incorrect conclusions.
Errors can occur in hypothesis testing.
| Population Condition | Conclusion: Accept H0 | Conclusion: Reject H0 |
|---|---|---|
| H0 True | Correct Conclusion | Type I Error |
| Ha True | Type II Error | Correct Conclusion |
-
Type I Error: Rejecting H0 when it is true.
- The probability of a Type I error is denoted by α (alpha), the level of significance.
- Common values for α are 0.05 and 0.01.
-
Type II Error: Accepting H0 when it is false (i.e., Ha is true).
- The probability of a Type II error is denoted by β (beta). This is not always controlled in significance tests.
"Do not reject H0" is preferred over "accept H0" because it acknowledges uncertainty and avoids the risk of a Type II error.
📝 Example: A drug manufacturer seeks FDA approval.
- H0: The drug is safe and effective.
- Ha: The drug is not safe and effective.
- Type I Error: Approving an unsafe/ineffective drug (rejecting H0 when true).
- Type II Error: Rejecting a safe/effective drug (accepting H0 when false).
1.6 Population mean: σ known
This section covers hypothesis tests for a population mean when the population standard deviation (σ) is known. These methods are exact for normal populations or use the Central Limit Theorem for large sample sizes.
1.7 One-tailed tests for μ (σ known)
These tests are used when the alternative hypothesis specifies a direction (< or >).
-
Lower Tail Test:
- H0:μ≥μ0
- Ha:μ<μ0
- Used to check if the mean is significantly less than a hypothesized value.
-
Upper Tail Test:
- H0:μ≤μ0
- Ha:μ>μ0
- Used to check if the mean is significantly greater than a hypothesized value.
📝 Example (Lower Tail): FTC testing Hilltop Coffee cans.
- Claim: Can contains at least 3 pounds (μ≥3).
- H0:μ≥3
- Ha:μ<3 (Label violation if true)
- Level of significance α=0.01.
1.8 Test statistic for μ (σ known)
When the population is normal or the sample size is large (n≥30), the test statistic follows a standard normal distribution (z).
-
Test Statistic (z): z=σ/nxˉ−μ0 where:
- xˉ is the sample mean.
- μ0 is the hypothesized population mean.
- σ is the population standard deviation.
- n is the sample size.
-
The term nσ is the standard error of the sample mean (xˉ).
1.9 p-value approach
The p-value quantifies the evidence against the null hypothesis.
- p-value: The probability of observing a test statistic as extreme as, or more extreme than, the one computed from the sample, assuming H0 is true.
- A small p-value indicates strong evidence against H0.
The decision rule for the p-value approach: Reject H0 if the p-value ≤α.
1.10 Critical value approach
This approach involves comparing the test statistic to a critical value from the standard normal distribution.
- Critical Value: A threshold value that defines the rejection region. It depends on the chosen level of significance (α) and the type of test (one-tailed or two-tailed).
The decision rule for the critical value approach:
- Lower Tail: Reject H0 if z≤−zα.
- Upper Tail: Reject H0 if z≥zα.
- Two-Tailed: Reject H0 if z≤−zα/2 or z≥zα/2.
🔑 Important: Hypothesis testing provides a framework to make decisions based on sample data, balancing the risks of Type I and Type II errors. Understanding the formulation of H0 and Ha is crucial.
1.11 Core concepts of hypothesis testing
Hypothesis testing is a statistical method used to make decisions about a population based on sample data. It involves formulating a hypothesis and then using sample evidence to determine if that hypothesis is likely true or false.
- Null hypothesis (H0): A statement of no effect or no difference. It represents the status quo or a default assumption.
- Alternative hypothesis (Ha): A statement that contradicts the null hypothesis. It represents what the researcher is trying to find evidence for.
When conducting a hypothesis test, there is a possibility of making errors.
- Type I error: Rejecting the null hypothesis when it is actually true. The probability of this error is denoted by α (alpha), also known as the level of significance.
- Type II error: Failing to reject the null hypothesis when it is actually false. The probability of this error is denoted by β (beta).
1.12 Hypothesis tests for a population mean (σ known)
This section focuses on testing hypotheses about a population mean (μ) when the population standard deviation (σ) is known. The test statistic used is a z-score.
- Test statistic: The value calculated from sample data to assess the hypothesis. For a known population standard deviation, it is:
z=σ/nxˉ−μ0 where:
- xˉ is the sample mean.
- μ0 is the hypothesized population mean.
- σ is the population standard deviation.
- n is the sample size.
Hypothesis tests can be one-tailed or two-tailed.
- Lower tail test: Used when the alternative hypothesis is that the population mean is less than a specific value (Ha:μ<μ0).
- Upper tail test: Used when the alternative hypothesis is that the population mean is greater than a specific value (Ha:μ>μ0).
- Two-tailed test: Used when the alternative hypothesis is that the population mean is not equal to a specific value (Ha:μ=μ0).
1.13 The p-value approach
The p-value approach uses the probability of observing sample results as extreme as, or more extreme than, the observed results, assuming the null hypothesis is true.
- p-value definition: The probability of obtaining a test statistic as extreme as, or more extreme than, the one observed from the sample, given that the null hypothesis is true.
- Decision rule:
- If p-value≤α, reject H0.
- If p-value>α, do not reject H0.
The p-value is also known as the observed level of significance.
Calculating p-values
- Lower tail test: p-value=P(Z≤zcalculated)
- Upper tail test: p-value=P(Z≥zcalculated)
- Two-tailed test: p-value=2×P(Z≥∣zcalculated∣) (assuming zcalculated is positive, otherwise 2×P(Z≤zcalculated) for negative zcalculated)
Smaller p-value means stronger evidence against H0.
1.14 The critical value approach
The critical value approach involves comparing the calculated test statistic to a critical value determined by the significance level (α).
- Critical value: The boundary value in the sampling distribution that separates the rejection region from the non-rejection region.
- Rejection region: The set of values for the test statistic that leads to the rejection of the null hypothesis.
Decision rules for critical values
- Lower tail test: Reject H0 if zcalculated≤zα (where zα has α area in the lower tail).
- Upper tail test: Reject H0 if zcalculated≥zα (where zα has α area in the upper tail).
- Two-tailed test: Reject H0 if zcalculated≤−zα/2 or zcalculated≥zα/2 (where zα/2 has α/2 area in the upper tail).
Both the p-value and critical value approaches yield the same conclusion.
1.15 Summary of hypothesis testing procedures
| Test Type | Hypotheses | Test Statistic (z) | p-Value Approach | Critical Value Approach |
|---|---|---|---|---|
| Lower Tail | H0:μ=μ0 | z=σ/nxˉ−μ0 | Reject H0 if p-value≤α | Reject H0 if z≤−zα |
| Upper Tail | H0:μ=μ0 | z=σ/nxˉ−μ0 | Reject H0 if p-value≤α | Reject H0 if z≥zα |
| Two-Tailed | H0:μ=μ0 | z=σ/nxˉ−μ0 | Reject H0 if p-value≤α | Reject H0 if z≤−zα/2 or z≥zα/2 |
- Steps of hypothesis testing:
- Formulate hypotheses.
- Specify the significance level (α).
- Collect data and compute the test statistic.
- Compute the p-value or determine the critical value and rejection rule.
- Make a decision: reject or do not reject H0.
- Interpret the conclusion in context.
For sample sizes n≥30, the procedure is generally valid. If n<30, the population should be normally distributed.
1.16 Relationship between interval estimation and hypothesis testing
A confidence interval can be used to perform a two-tailed hypothesis test.
- Confidence interval approach for two-tailed tests:
- Construct a (1−α)×100% confidence interval for the population mean μ.
- If the confidence interval contains the hypothesized value μ0, do not reject H0.
- If the confidence interval does not contain μ0, reject H0.
This relationship holds because a (1−α)×100% confidence interval corresponds to a two-tailed test with a significance level of α.
🔑 Important: Hypothesis testing helps decide if sample data provides enough evidence to reject a claim about a population parameter.
1.17 Core concepts of hypothesis testing
Hypothesis testing is a statistical method to make decisions about a population based on sample data. It involves setting up two competing statements about a population parameter.
You then use sample evidence to decide which statement is more likely to be true.
- Null hypothesis (H0): A statement of no effect or no difference. It represents the status quo or a default assumption.
- Alternative hypothesis (Ha or H1): A statement that contradicts the null hypothesis. It represents what you are trying to find evidence for.
There are two types of errors that can occur during hypothesis testing:
- Type I error: Rejecting a true null hypothesis. The probability of this error is denoted by α.
- Type II error: Failing to reject a false null hypothesis. The probability of this error is denoted by β.
🔑 Important: Hypothesis testing aims to find evidence against the null hypothesis, not to prove it.
1.18 Testing a population mean with known standard deviation
When testing a hypothesis about a population mean (μ) and the population standard deviation (σ) is known, we use the z-distribution. The z-test statistic measures how many standard errors the sample mean is away from the hypothesized population mean.
- Test statistic formula: The formula for the z-test statistic is:
- μ0 is the hypothesized population mean (from H0).
We can use two approaches to make a decision: the p-value approach or the critical value approach.
1.19 The p-value approach
The p-value is the probability of observing a sample statistic as extreme as, or more extreme than, the one computed from the sample, assuming the null hypothesis is true.
- Decision rule:
- If p-value ≤α (significance level), reject H0.
- If p-value >α, fail to reject H0.
1.20 The critical value approach
The critical value is a threshold determined by the significance level (α) and the type of test (one-tailed or two-tailed). It separates the rejection region from the non-rejection region.
* For a <span style="color: #ff9f29; font-weight: 700;">right-tailed test</span>: If $z \ge z_{\alpha}$, reject $H_0$.
* For a <span style="color: #ff9f29; font-weight: 700;">left-tailed test</span>: If $z \le -z_{\alpha}$, reject $H_0$.
* For a <span style="color: #ff9f29; font-weight: 700;">two-tailed test</span>: If $|z| \ge z_{\alpha/2}$, reject $H_0$.
🔑 Important: A smaller p-value provides stronger evidence against the null hypothesis.
1.21 Hypothesis test types
Hypothesis tests can be one-tailed or two-tailed, depending on the alternative hypothesis.
| Test Type | Alternative Hypothesis (Ha) | Rejection Region (Critical Value Approach) |
|---|---|---|
| Right-tailed | μ>μ0 | z≥zα |
| Left-tailed | μ<μ0 | z≤−zα |
| Two-tailed | μ=μ0 | $ |
- Right-tailed test: Used when we suspect the population mean is greater than a claimed value.
- Left-tailed test: Used when we suspect the population mean is less than a claimed value.
- Two-tailed test: Used when we suspect the population mean is different from a claimed value (either greater or smaller).
🔑 Important: The alternative hypothesis dictates the type of test and the direction of the rejection region.
1.22 Examples of hypothesis testing
Here are examples illustrating the application of hypothesis testing for a population mean with a known population standard deviation.
📝 Example: A taxpayer advocate claims the mean waiting time for IRS calls is 12 minutes. A sample of 50 callers shows a mean waiting time of 10 minutes. The population standard deviation is 8 minutes. We want to test if the actual mean waiting time is less than 12 minutes at α=0.05.
- H0: μ=12 minutes
- Ha: μ<12 minutes (left-tailed test)
- α=0.05
- Sample mean (xˉ) = 10 minutes
- Population standard deviation (σ) = 8 minutes
- Sample size (n) = 50
- Test statistic: z=8/5010−12≈1.131−2≈−1.77
- Critical value for α=0.05 in a left-tailed test is approximately -1.645.
- Since −1.77<−1.645, we reject H0.
- Conclusion: The actual mean waiting time is significantly less than the 12-minute claim.
📝 Example: A client is charged based on the assumption that telephone surveys take 15 minutes or less. A sample of 35 surveys shows a mean survey time of 17 minutes. The population standard deviation is 4 minutes. We want to test if the premium rate is justified (i.e., if the mean time is greater than 15 minutes) at α=0.01.
- H0: μ=15 minutes
- Ha: μ>15 minutes (right-tailed test)
- α=0.01
- Sample mean (xˉ) = 17 minutes
- Population standard deviation (σ) = 4 minutes
- Sample size (n) = 35
- Test statistic: z=4/3517−15≈0.6762≈2.96
- Critical value for α=0.01 in a right-tailed test is approximately 2.326.
- Since 2.96>2.326, we reject H0.
- Conclusion: The premium rate is justified; the mean survey time is significantly greater than 15 minutes.
🔑 Important: When testing a population mean with a known standard deviation, use the z-distribution for calculating the test statistic and p-value.
2. Hypothesis tests for population mean with unknown standard deviation
When the population standard deviation (σ) is unknown, we use the sample standard deviation (s) as an estimate. This requires using the t-distribution instead of the standard normal distribution.
The t-distribution accounts for the extra uncertainty introduced by estimating σ.
2.1 Test statistic and t-distribution
-
Test statistic: The formula for the test statistic when σ is unknown is: t=s/nxˉ−μ0 Here, xˉ is the sample mean, μ0 is the hypothesized population mean, s is the sample standard deviation, and n is the sample size.
-
t-distribution: The test statistic follows a t-distribution with n−1 degrees of freedom. This distribution is similar to the normal distribution but has heavier tails, reflecting greater variability due to estimating σ.
-
Assumptions: The t-distribution is based on the assumption that the population is normally distributed. However, this assumption can be relaxed for larger sample sizes. For sample sizes of 30 or more, the t-test generally provides good results. For smaller sample sizes, the population should be approximately normal. Highly skewed populations or those with outliers suggest larger sample sizes are needed.
2.2 Conducting hypothesis tests
Hypothesis tests for a population mean with unknown σ follow the same structure as tests with known σ, but use the t-distribution.
2.2.1 One-tailed tests
-
Upper tail test:
- Hypotheses: H0:μ≤μ0 vs. Ha:μ>μ0
- Reject H0 if t≥tα or if the p-value is ≤α.
-
Lower tail test:
- Hypotheses: H0:μ≥μ0 vs. Ha:μ<μ0
- Reject H0 if t≤−tα or if the p-value is ≤α.
2.2.2 Two-tailed tests
- Hypotheses: H0:μ=μ0 vs. Ha:μ=μ0
- Rejection rule: Reject H0 if t≤−tα/2 or if t≥tα/2. Alternatively, reject H0 if the p-value is ≤α.
2.3 Summary table for hypothesis tests
| Test Type | Hypotheses | Test Statistic | p-Value Approach | Critical Value Approach |
|---|---|---|---|---|
| Lower Tail | H0:μ≥μ0 | t=s/nxˉ−μ0 | p-value ≤α | t≤−tα |
| Upper Tail | H0:μ≤μ0 | t=s/nxˉ−μ0 | p-value ≤α | t≥tα |
| Two-Tailed | H0:μ=μ0 | t=s/nxˉ−μ0 | p-value ≤α | t≤−tα/2 or t≥tα/2 |
The key difference from σ-known tests is the use of the t-distribution due to estimating σ with s.
🔑 Important: For σ unknown, always use the t-distribution with n−1 degrees of freedom. The sample standard deviation s replaces σ in the test statistic formula.
3. Advanced hypothesis testing concepts and sample size determination
3.1 Hypothesis testing and decision making
In hypothesis testing, we control the probability of a Type I error (α), which is rejecting a true null hypothesis (H0). However, the probability of a Type II error (β), failing to reject a false null hypothesis, is not directly controlled in standard significance tests.
If the goal is to make a decision with actions taken for both accepting and rejecting H0, controlling β becomes crucial. This allows for definitive conclusions: either accept H0 or accept the alternative hypothesis (Ha).
🔑 Important: When a decision must be made, controlling both α and β is recommended.
3.2 Calculating the probability of Type II errors
A Type II error (β) occurs when we fail to reject H0 when Ha is actually true. Calculating β requires specifying a particular value for the population parameter under Ha.
The procedure involves:
- Stating the hypotheses.
- Determining the critical value and rejection rule using α.
- Identifying the acceptance region (values of the sample statistic that lead to not rejecting H0).
- Using the sampling distribution of the statistic under a specific value of the parameter from Ha to find the probability of the sample statistic falling into the acceptance region.
Probability of Type II error calculation steps
| Step | Action |
|---|---|
| 1 | Formulate H0 and Ha. |
| 2 | Determine critical value and rejection rule using α. |
| 3 | Solve for the critical sample statistic value (e.g., xˉ) from the rejection rule. |
| 4 | Define the acceptance region based on the critical sample statistic. |
| 5 | Compute the probability of the sample statistic falling in the acceptance region, assuming a specific parameter value from Ha. |
The probability of correctly rejecting a false H0 is called the power of the test (1−β). A power curve graphically shows this probability for various parameter values.
📝 Example: For H0:μ≥120 and Ha:μ<120, if α=0.05, σ=12, and n=36, the rejection rule is xˉ≤116.71. If the true mean is μ=112, the z-score for xˉ=116.71 is z=(116.71−112)/(12/36)=2.36. The probability of Type II error (β) is the area to the right of z=2.36, which is 1−0.9909=0.0091.
3.3 Determining the sample size for a hypothesis test
To control both Type I (α) and Type II (β) errors, we can determine the necessary sample size. This requires specifying desired probabilities for both errors and the critical values associated with them.
Sample size formula for a one-tailed test about a population mean
The formula to determine the sample size (n) for a one-tailed hypothesis test about a population mean (μ) is:
n=(μ0−μα)2(zα+zβ)2σ2
where:
- zα: The z-score providing an area of α in the upper tail of the standard normal distribution.
- zβ: The z-score providing an area of β in the upper tail of the standard normal distribution.
- σ: The population standard deviation.
- μ0: The value of the population mean in the null hypothesis.
- μα: The value of the population mean used for the Type II error calculation.
For a two-tailed test, replace zα with zα/2.
🔑 Important: Once two of the three values (α, β, n) are known, the third can be computed. Increasing the sample size (n) reduces the probability of a Type II error (β) for a given α. Conversely, decreasing α increases β for a fixed n.
Sample size determination example
Consider a lot-acceptance test with H0:μ≥120 and Ha:μ<120. The manager wants α=0.05 (rejecting H0 when μ=120) and β=0.10 (accepting H0 when μ=115).
Given σ=12, we have z0.05=1.645 and z0.10=1.28.
Using the sample size formula:
n = \frac{(1.645 + 1.28)^2 ^2}{(120 - 115)^2} = \frac{(2.925)^2 }{ ^2} = \frac{8.555625 \times 144}{25} \approx 49.3 12 .
Rounding up, a sample size of n=50 is recommended.
🔑 Important: Controlling both Type I and Type II error probabilities allows for justified decisions (accept or reject H0) with known error risks.
🔑 Important: The most crucial aspect of this topic is understanding the trade-off between Type I and Type II errors and how sample size influences their control, enabling informed decision-making in hypothesis testing.
3.4 Understanding error probabilities
In hypothesis testing, we aim to make a decision about a population based on sample data. However, our decisions can be incorrect.
There are two types of errors:
- Type I error: Rejecting the null hypothesis (H0) when it is actually true. The probability of this error is denoted by α, the significance level.
- Type II error: Failing to reject the null hypothesis (H0) when it is actually false. The probability of this error is denoted by β.
Controlling both Type I and Type II errors is crucial for robust hypothesis testing.
3.5 Calculating Type II error probability (β)
The probability of a Type II error, β, depends on several factors. It increases with the sample size.
It also depends on the true value of the population parameter and the significance level α.
3.6 Factors influencing β
The calculation of β requires knowledge of the true population parameter value, which is usually unknown. When we hypothesize a specific value for the parameter under the null hypothesis, β is calculated based on an alternative, true value of the parameter.
3.7 β for a one-tailed test about a population mean
For a one-tailed test about a population mean when the population standard deviation (σ) is known, β is calculated by considering the distribution of the sample mean under the alternative hypothesis.
Let the null hypothesis be H0:μ=μ0 and the alternative hypothesis be Ha:μ>μ0. If the true population mean is μa, then β is the probability of failing to reject H0 when μ=μa.
This occurs if the sample mean xˉ falls below the critical value c for the test.
The critical value c is found using the significance level α and the standard normal distribution: c=μ0+zασ where zα is the z-score such that the area to its right is α.
The probability of a Type II error is then: β=P(xˉ<c∣μ=μa) This can be calculated by standardizing the critical value using the distribution of xˉ under the assumption that μ=μa: z=σ/nc−μa So, β=P(Z<z)=Φ(σ/nc−μa) where Φ is the cumulative distribution function of the standard normal distribution.
3.8 β for a one-tailed test about a population proportion
For a one-tailed test about a population proportion, p, when the sample size n is large enough for the normal approximation to be valid, β is calculated similarly.
Let the null hypothesis be H0:p=p0 and the alternative hypothesis be Ha:p>p0. If the true population proportion is pa, then β is the probability of failing to reject H0 when p=pa.
This occurs if the sample proportion p^ falls below the critical value c for the test.
The critical value c is found using the significance level α and the standard normal distribution: c=p0+zαnp0(1−p0)
The probability of a Type II error is then: β=P(p^<c∣p=pa) This is calculated by standardizing c using the distribution of p^ under the assumption that p=pa: z=npa(1−pa)c−pa So, β=P(Z<z)=Φ(npa(1−pa)c−pa)
3.9 Sample size determination
Determining the appropriate sample size is crucial for ensuring that a hypothesis test has sufficient power to detect a meaningful effect. Sample size calculations help control both Type I and Type II errors.
3.10 Sample size for a mean
To determine the required sample size (n) for a hypothesis test about a population mean (μ) when σ is known, we consider the desired significance level α and the desired probability of a Type II error β. We also need to specify the smallest difference between the true population mean and the hypothesized mean that we want to be able to detect (the "effect size").
Let this difference be Δ=∣μa−μ0∣.
For a two-tailed test, the formula for n is: n=Δ2(zα/2+zβ)2σ2 where zα/2 is the z-score for the significance level α in a two-tailed test, and zβ is the z-score for the probability of Type II error β.
For a one-tailed test, the formula uses zα instead of zα/2: n=Δ2(zα+zβ)2σ2
3.11 Sample size for a proportion
Similarly, for a hypothesis test about a population proportion (p), the sample size n can be determined. We need the desired significance level α, the desired probability of a Type II error β, and the smallest difference in proportions we want to detect, Δ=∣pa−p0∣.
For a two-tailed test: n=(pa−p0)2(zα/2+zβ)2p0(1−p0) When pa is not known, a conservative approach is to use p=0.5 in the (pa−p0)2 term if p0 is not 0.5. If pa is close to p0, it might be better to use an estimate of pa.
For a one-tailed test: n=(pa−p0)2(zα+zβ)2p0(1−p0)
The required sample size increases as the desired power (1−β) increases and as the effect size (Δ) decreases.
3.12 Power of a test
The power of a hypothesis test is defined as 1−β, which is the probability of correctly rejecting a false null hypothesis. A higher power means a greater chance of detecting a true effect.
A test with higher power is more likely to detect a false null hypothesis.
3.13 Planning values
When determining sample size, we often need to make educated guesses for certain parameters.
- Population standard deviation (σ) or proportion (p0,pa): These are often estimated from previous studies, pilot studies, or based on expert judgment.
- Effect size (Δ): This is the minimum difference that is considered practically significant.
These estimates are called "planning values."
3.14 Relationship between sample size, α, β, and effect size
The choice of sample size is a trade-off between cost, time, and statistical rigor.
| Parameter | Effect |
|---|---|
| Sample Size (n) | Larger n reduces both α and β for a fixed effect size. |
| Significance Level (α) | Increasing α reduces β but increases Type I error probability. |
| Type II Error Prob (β) | Decreasing β (increasing power) requires a larger n for a fixed α and effect size. |
| Effect Size (Δ) | Smaller effect sizes require larger n to be detected. |
A larger sample size allows for better control over both types of errors.
🔑 Important: Sample size determination involves balancing the probability of Type I and Type II errors with the practical significance of the effect you wish to detect.
3.15 Power curves
A power curve is a graphical representation of the power of a hypothesis test for all possible values of the population parameter under the alternative hypothesis. It plots the power (1−β) against the possible values of the population parameter.
- The curve shows how the probability of correctly rejecting the null hypothesis changes as the true value of the parameter moves away from the value specified in the null hypothesis.
- The power is low when the true parameter value is close to the null hypothesis value.
- The power increases as the true parameter value moves further away from the null hypothesis value.
Power curves visually illustrate the sensitivity of a test to different effect sizes.
🔑 Important: The power of a test is its ability to detect a false null hypothesis. Sample size calculations aim to achieve a desired level of power.
© 2026 Maeve. All rights reserved. This content is protected by copyright.