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 (H0H_0): A tentative assumption about a population parameter. It's the statement being challenged.
  • Alternative hypothesis (HaH_a): 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 (HaH_a) based on what they want to prove. The null hypothesis (H0H_0) 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.
    • HaH_a: The new system increases miles per gallon (μ>24\mu > 24).
    • H0H_0: The new system does not increase miles per gallon (μ≤24\mu \le 24).

1.3 When the null hypothesis is an assumption to be challenged

The null hypothesis (H0H_0) represents an existing belief or assumption. The alternative hypothesis (HaH_a) challenges this assumption.

  • Example: A soft drink label claims 67.6 fluid ounces.

    • H0H_0: The mean filling weight is at least 67.6 ounces (μ≥67.6\mu \ge 67.6). (Manufacturer's perspective, challenging claims if underfilled)
    • HaH_a: The mean filling weight is less than 67.6 ounces (μ<67.6\mu < 67.6).
  • Example: Manufacturer's quality control for a 67.6-ounce bottle.

    • H0H_0: The mean filling weight is equal to 67.6 ounces (μ=67.6\mu = 67.6). (Process is working correctly)
    • HaH_a: The mean filling weight is not equal to 67.6 ounces (μ≠67.6\mu \ne 67.6). (Overfilling or underfilling is occurring)

The equality sign (==, ≤\le, or ≥\ge) always belongs in the null hypothesis (H0H_0).

1.4 Forms of null and alternative hypotheses for a population mean (μ\mu)

There are three possible forms for hypothesis tests concerning a population mean (μ0\mu_0 is the hypothesized value):

Null Hypothesis (H0H_0)Alternative Hypothesis (HaH_a)Test Type
μ≥μ0\mu \ge \mu_0μ<μ0\mu < \mu_0Lower Tail
μ≤μ0\mu \le \mu_0μ>μ0\mu > \mu_0Upper Tail
μ=μ0\mu = \mu_0μ≠μ0\mu \ne \mu_0Two-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 ConditionConclusion: Accept H0H_0Conclusion: Reject H0H_0
H0H_0 TrueCorrect ConclusionType I Error
HaH_a TrueType II ErrorCorrect Conclusion
  • Type I Error: Rejecting H0H_0 when it is true.

    • The probability of a Type I error is denoted by α\alpha (alpha), the level of significance.
    • Common values for α\alpha are 0.05 and 0.01.
  • Type II Error: Accepting H0H_0 when it is false (i.e., HaH_a is true).

    • The probability of a Type II error is denoted by β\beta (beta). This is not always controlled in significance tests.

"Do not reject H0H_0" is preferred over "accept H0H_0" because it acknowledges uncertainty and avoids the risk of a Type II error.

📝 Example: A drug manufacturer seeks FDA approval.

  • H0H_0: The drug is safe and effective.
  • HaH_a: The drug is not safe and effective.
  • Type I Error: Approving an unsafe/ineffective drug (rejecting H0H_0 when true).
  • Type II Error: Rejecting a safe/effective drug (accepting H0H_0 when false).

1.6 Population mean: σ\sigma known

This section covers hypothesis tests for a population mean when the population standard deviation (σ\sigma) 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 μ\mu (σ\sigma known)

These tests are used when the alternative hypothesis specifies a direction (<< or >>).

  • Lower Tail Test:

    • H0:μ≥μ0H_0: \mu \ge \mu_0
    • Ha:μ<μ0H_a: \mu < \mu_0
    • Used to check if the mean is significantly less than a hypothesized value.
  • Upper Tail Test:

    • H0:μ≤μ0H_0: \mu \le \mu_0
    • Ha:μ>μ0H_a: \mu > \mu_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\mu \ge 3).
  • H0:μ≥3H_0: \mu \ge 3
  • Ha:μ<3H_a: \mu < 3 (Label violation if true)
  • Level of significance α=0.01\alpha = 0.01.

1.8 Test statistic for μ\mu (σ\sigma known)

When the population is normal or the sample size is large (n≥30n \ge 30), the test statistic follows a standard normal distribution (zz).

  • Test Statistic (zz): z=xˉ−μ0σ/nz = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} where:

    • xˉ\bar{x} is the sample mean.
    • μ0\mu_0 is the hypothesized population mean.
    • σ\sigma is the population standard deviation.
    • nn is the sample size.
  • The term σn\frac{\sigma}{\sqrt{n}} is the standard error of the sample mean (xˉ\bar{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 H0H_0 is true.
    • A small p-value indicates strong evidence against H0H_0.

The decision rule for the p-value approach: Reject H0H_0 if the p-value ≤α\le \alpha.

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 (α\alpha) and the type of test (one-tailed or two-tailed).

The decision rule for the critical value approach:

  • Lower Tail: Reject H0H_0 if z≤−zαz \le -z_\alpha.
  • Upper Tail: Reject H0H_0 if z≥zαz \ge z_\alpha.
  • Two-Tailed: Reject H0H_0 if z≤−zα/2z \le -z_{\alpha/2} or z≥zα/2z \ge z_{\alpha/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 H0H_0 and HaH_a 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 (H0H_0): A statement of no effect or no difference. It represents the status quo or a default assumption.
  • Alternative hypothesis (HaH_a): 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 (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 (beta).

1.12 Hypothesis tests for a population mean (σ\sigma known)

This section focuses on testing hypotheses about a population mean (μ\mu) when the population standard deviation (σ\sigma) 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=xˉ−μ0σ/nz = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} where:
    • xˉ\bar{x} is the sample mean.
    • μ0\mu_0 is the hypothesized population mean.
    • σ\sigma is the population standard deviation.
    • nn 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:μ<μ0H_a: \mu < \mu_0).
  • Upper tail test: Used when the alternative hypothesis is that the population mean is greater than a specific value (Ha:μ>μ0H_a: \mu > \mu_0).
  • Two-tailed test: Used when the alternative hypothesis is that the population mean is not equal to a specific value (Ha:μ≠μ0H_a: \mu \neq \mu_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≤αp\text{-value} \le \alpha, reject H0H_0.
    • If p-value>αp\text{-value} > \alpha, do not reject H0H_0.

The p-value is also known as the observed level of significance.

Calculating p-values

  • Lower tail test: p-value=P(Z≤zcalculated)p\text{-value} = P(Z \le z_{calculated})
  • Upper tail test: p-value=P(Z≥zcalculated)p\text{-value} = P(Z \ge z_{calculated})
  • Two-tailed test: p-value=2×P(Z≥∣zcalculated∣)p\text{-value} = 2 \times P(Z \ge |z_{calculated}|) (assuming zcalculatedz_{calculated} is positive, otherwise 2×P(Z≤zcalculated)2 \times P(Z \le z_{calculated}) for negative zcalculatedz_{calculated})

Smaller p-value means stronger evidence against H0H_0.

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 (α\alpha).

  • 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 H0H_0 if zcalculated≤zαz_{calculated} \le z_{\alpha} (where zαz_{\alpha} has α\alpha area in the lower tail).
  • Upper tail test: Reject H0H_0 if zcalculated≥zαz_{calculated} \ge z_{\alpha} (where zαz_{\alpha} has α\alpha area in the upper tail).
  • Two-tailed test: Reject H0H_0 if zcalculated≤−zα/2z_{calculated} \le -z_{\alpha/2} or zcalculated≥zα/2z_{calculated} \ge z_{\alpha/2} (where zα/2z_{\alpha/2} has α/2\alpha/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 TypeHypothesesTest Statistic (zz)p-Value ApproachCritical Value Approach
Lower TailH0:μ=μ0H_0: \mu = \mu_0z=xˉ−μ0σ/nz = \frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}Reject H0H_0 if p-value≤αp\text{-value} \le \alphaReject H0H_0 if z≤−zαz \le -z_\alpha
Upper TailH0:μ=μ0H_0: \mu = \mu_0z=xˉ−μ0σ/nz = \frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}Reject H0H_0 if p-value≤αp\text{-value} \le \alphaReject H0H_0 if z≥zαz \ge z_\alpha
Two-TailedH0:μ=μ0H_0: \mu = \mu_0z=xˉ−μ0σ/nz = \frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}Reject H0H_0 if p-value≤αp\text{-value} \le \alphaReject H0H_0 if z≤−zα/2z \le -z_{\alpha/2} or z≥zα/2z \ge z_{\alpha/2}
  • Steps of hypothesis testing:
    1. Formulate hypotheses.
    2. Specify the significance level (α\alpha).
    3. Collect data and compute the test statistic.
    4. Compute the p-value or determine the critical value and rejection rule.
    5. Make a decision: reject or do not reject H0H_0.
    6. Interpret the conclusion in context.

For sample sizes n≥30n \ge 30, the procedure is generally valid. If n<30n < 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:
    1. Construct a (1−α)×100%(1-\alpha) \times 100\% confidence interval for the population mean μ\mu.
    2. If the confidence interval contains the hypothesized value μ0\mu_0, do not reject H0H_0.
    3. If the confidence interval does not contain μ0\mu_0, reject H0H_0.

This relationship holds because a (1−α)×100%(1-\alpha) \times 100\% confidence interval corresponds to a two-tailed test with a significance level of α\alpha.

🔑 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 (H0H_0): A statement of no effect or no difference. It represents the status quo or a default assumption.
  • Alternative hypothesis (HaH_a or H1H_1): 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 α\alpha.
  • Type II error: Failing to reject a false null hypothesis. The probability of this error is denoted by β\beta.

🔑 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 (μ\mu) and the population standard deviation (σ\sigma) 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\mu_0 is the hypothesized population mean (from H0H_0).

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 ≤α\le \alpha (significance level), reject H0H_0.
    • If p-value >α> \alpha, fail to reject H0H_0.

1.20 The critical value approach

The critical value is a threshold determined by the significance level (α\alpha) 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 TypeAlternative Hypothesis (HaH_a)Rejection Region (Critical Value Approach)
Right-tailedμ>μ0\mu > \mu_0z≥zαz \ge z_{\alpha}
Left-tailedμ<μ0\mu < \mu_0z≤−zαz \le -z_{\alpha}
Two-tailedμ≠μ0\mu \ne \mu_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\alpha = 0.05.

  • H0H_0: μ=12\mu = 12 minutes
  • HaH_a: μ<12\mu < 12 minutes (left-tailed test)
  • α=0.05\alpha = 0.05
  • Sample mean (xˉ\bar{x}) = 10 minutes
  • Population standard deviation (σ\sigma) = 8 minutes
  • Sample size (nn) = 50
  • Test statistic: z=10−128/50≈−21.131≈−1.77z = \frac{10 - 12}{8 / \sqrt{50}} \approx \frac{-2}{1.131} \approx -1.77
  • Critical value for α=0.05\alpha = 0.05 in a left-tailed test is approximately -1.645.
  • Since −1.77<−1.645-1.77 < -1.645, we reject H0H_0.
  • 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\alpha = 0.01.

  • H0H_0: μ=15\mu = 15 minutes
  • HaH_a: μ>15\mu > 15 minutes (right-tailed test)
  • α=0.01\alpha = 0.01
  • Sample mean (xˉ\bar{x}) = 17 minutes
  • Population standard deviation (σ\sigma) = 4 minutes
  • Sample size (nn) = 35
  • Test statistic: z=17−154/35≈20.676≈2.96z = \frac{17 - 15}{4 / \sqrt{35}} \approx \frac{2}{0.676} \approx 2.96
  • Critical value for α=0.01\alpha = 0.01 in a right-tailed test is approximately 2.326.
  • Since 2.96>2.3262.96 > 2.326, we reject H0H_0.
  • 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 (σ\sigma) is unknown, we use the sample standard deviation (ss) 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 σ\sigma.

2.1 Test statistic and t-distribution

  • Test statistic: The formula for the test statistic when σ\sigma is unknown is: t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} Here, xˉ\bar{x} is the sample mean, μ0\mu_0 is the hypothesized population mean, ss is the sample standard deviation, and nn is the sample size.

  • t-distribution: The test statistic follows a t-distribution with n−1n-1 degrees of freedom. This distribution is similar to the normal distribution but has heavier tails, reflecting greater variability due to estimating σ\sigma.

  • 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 σ\sigma follow the same structure as tests with known σ\sigma, but use the t-distribution.

2.2.1 One-tailed tests

  • Upper tail test:

    • Hypotheses: H0:μ≤μ0H_0: \mu \le \mu_0 vs. Ha:μ>μ0H_a: \mu > \mu_0
    • Reject H0H_0 if t≥tαt \ge t_{\alpha} or if the p-value is ≤α\le \alpha.
  • Lower tail test:

    • Hypotheses: H0:μ≥μ0H_0: \mu \ge \mu_0 vs. Ha:μ<μ0H_a: \mu < \mu_0
    • Reject H0H_0 if t≤−tαt \le -t_{\alpha} or if the p-value is ≤α\le \alpha.

2.2.2 Two-tailed tests

  • Hypotheses: H0:μ=μ0H_0: \mu = \mu_0 vs. Ha:μ≠μ0H_a: \mu \ne \mu_0
  • Rejection rule: Reject H0H_0 if t≤−tα/2t \le -t_{\alpha/2} or if t≥tα/2t \ge t_{\alpha/2}. Alternatively, reject H0H_0 if the p-value is ≤α\le \alpha.

2.3 Summary table for hypothesis tests

Test TypeHypothesesTest Statisticp-Value ApproachCritical Value Approach
Lower TailH0:μ≥μ0H_0: \mu \ge \mu_0t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}p-value ≤α\le \alphat≤−tαt \le -t_{\alpha}
Upper TailH0:μ≤μ0H_0: \mu \le \mu_0t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}p-value ≤α\le \alphat≥tαt \ge t_{\alpha}
Two-TailedH0:μ=μ0H_0: \mu = \mu_0t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}p-value ≤α\le \alphat≤−tα/2t \le -t_{\alpha/2} or t≥tα/2t \ge t_{\alpha/2}

The key difference from σ\sigma-known tests is the use of the t-distribution due to estimating σ\sigma with ss.

🔑 Important: For σ\sigma unknown, always use the t-distribution with n−1n-1 degrees of freedom. The sample standard deviation ss replaces σ\sigma 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 (α\alpha), which is rejecting a true null hypothesis (H0\text{H}_0). However, the probability of a Type II error (β\beta), 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\text{H}_0, controlling β\beta becomes crucial. This allows for definitive conclusions: either accept H0\text{H}_0 or accept the alternative hypothesis (Ha\text{H}_\text{a}).

🔑 Important: When a decision must be made, controlling both α\alpha and β\beta is recommended.

3.2 Calculating the probability of Type II errors

A Type II error (β\beta) occurs when we fail to reject H0\text{H}_0 when Ha\text{H}_\text{a} is actually true. Calculating β\beta requires specifying a particular value for the population parameter under Ha\text{H}_\text{a}.

The procedure involves:

  • Stating the hypotheses.
  • Determining the critical value and rejection rule using α\alpha.
  • Identifying the acceptance region (values of the sample statistic that lead to not rejecting H0\text{H}_0).
  • Using the sampling distribution of the statistic under a specific value of the parameter from Ha\text{H}_\text{a} to find the probability of the sample statistic falling into the acceptance region.

Probability of Type II error calculation steps

StepAction
1Formulate H0\text{H}_0 and Ha\text{H}_\text{a}.
2Determine critical value and rejection rule using α\alpha.
3Solve for the critical sample statistic value (e.g., xˉ\bar{x}) from the rejection rule.
4Define the acceptance region based on the critical sample statistic.
5Compute the probability of the sample statistic falling in the acceptance region, assuming a specific parameter value from Ha\text{H}_\text{a}.

The probability of correctly rejecting a false H0\text{H}_0 is called the power of the test (1−β1 - \beta). A power curve graphically shows this probability for various parameter values.

📝 Example: For H0:μ≥120\text{H}_0: \mu \ge 120 and Ha:μ<120\text{H}_\text{a}: \mu < 120, if α=0.05\alpha = 0.05, σ=12\sigma = 12, and n=36n = 36, the rejection rule is xˉ≤116.71\bar{x} \le 116.71. If the true mean is μ=112\mu = 112, the zz-score for xˉ=116.71\bar{x} = 116.71 is z=(116.71−112)/(12/36)=2.36z = (116.71 - 112) / (12 / \sqrt{36}) = 2.36. The probability of Type II error (β\beta) is the area to the right of z=2.36z = 2.36, which is 1−0.9909=0.00911 - 0.9909 = 0.0091.

3.3 Determining the sample size for a hypothesis test

To control both Type I (α\alpha) and Type II (β\beta) 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 (nn) for a one-tailed hypothesis test about a population mean (μ\mu) is:

n=(zα+zβ)2σ2(μ0−μα)2n = \frac{(z_\alpha + z_\beta)^2 \sigma^2}{(\mu_0 - \mu_\alpha)^2}

where:

  • zαz_\alpha: The zz-score providing an area of α\alpha in the upper tail of the standard normal distribution.
  • zβz_\beta: The zz-score providing an area of β\beta in the upper tail of the standard normal distribution.
  • σ\sigma: The population standard deviation.
  • μ0\mu_0: The value of the population mean in the null hypothesis.
  • μα\mu_\alpha: The value of the population mean used for the Type II error calculation.

For a two-tailed test, replace zαz_\alpha with zα/2z_{\alpha/2}.

🔑 Important: Once two of the three values (α\alpha, β\beta, nn) are known, the third can be computed. Increasing the sample size (nn) reduces the probability of a Type II error (β\beta) for a given α\alpha. Conversely, decreasing α\alpha increases β\beta for a fixed nn.

Sample size determination example

Consider a lot-acceptance test with H0:μ≥120\text{H}_0: \mu \ge 120 and Ha:μ<120\text{H}_\text{a}: \mu < 120. The manager wants α=0.05\alpha = 0.05 (rejecting H0\text{H}_0 when μ=120\mu=120) and β=0.10\beta = 0.10 (accepting H0\text{H}_0 when μ=115\mu=115).

Given σ=12\sigma = 12, we have z0.05=1.645z_{0.05} = 1.645 and z0.10=1.28z_{0.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=50n = 50 is recommended.

🔑 Important: Controlling both Type I and Type II error probabilities allows for justified decisions (accept or reject H0\text{H}_0) 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 (H0H_0) when it is actually true. The probability of this error is denoted by α\alpha, the significance level.
  • Type II error: Failing to reject the null hypothesis (H0H_0) when it is actually false. The probability of this error is denoted by β\beta.

Controlling both Type I and Type II errors is crucial for robust hypothesis testing.

3.5 Calculating Type II error probability (β\beta)

The probability of a Type II error, β\beta, 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 α\alpha.

3.6 Factors influencing β\beta

The calculation of β\beta 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, β\beta is calculated based on an alternative, true value of the parameter.

3.7 β\beta for a one-tailed test about a population mean

For a one-tailed test about a population mean when the population standard deviation (σ\sigma) is known, β\beta is calculated by considering the distribution of the sample mean under the alternative hypothesis.

Let the null hypothesis be H0:μ=μ0H_0: \mu = \mu_0 and the alternative hypothesis be Ha:μ>μ0H_a: \mu > \mu_0. If the true population mean is μa\mu_a, then β\beta is the probability of failing to reject H0H_0 when μ=μa\mu = \mu_a.

This occurs if the sample mean xˉ\bar{x} falls below the critical value cc for the test.

The critical value cc is found using the significance level α\alpha and the standard normal distribution: c=μ0+zασc = \mu_0 + z_{\alpha}\sigma where zαz_{\alpha} is the z-score such that the area to its right is α\alpha.

The probability of a Type II error is then: β=P(xˉ<c∣μ=μa)\beta = P(\bar{x} < c | \mu = \mu_a) This can be calculated by standardizing the critical value using the distribution of xˉ\bar{x} under the assumption that μ=μa\mu = \mu_a: z=c−μaσ/nz = \frac{c - \mu_a}{\sigma / \sqrt{n}} So, β=P(Z<z)=Φ(c−μaσ/n)\beta = P(Z < z) = \Phi\left(\frac{c - \mu_a}{\sigma / \sqrt{n}}\right) where Φ\Phi is the cumulative distribution function of the standard normal distribution.

3.8 β\beta for a one-tailed test about a population proportion

For a one-tailed test about a population proportion, pp, when the sample size nn is large enough for the normal approximation to be valid, β\beta is calculated similarly.

Let the null hypothesis be H0:p=p0H_0: p = p_0 and the alternative hypothesis be Ha:p>p0H_a: p > p_0. If the true population proportion is pap_a, then β\beta is the probability of failing to reject H0H_0 when p=pap = p_a.

This occurs if the sample proportion p^\hat{p} falls below the critical value cc for the test.

The critical value cc is found using the significance level α\alpha and the standard normal distribution: c=p0+zαp0(1−p0)nc = p_0 + z_{\alpha}\sqrt{\frac{p_0(1 - p_0)}{n}}

The probability of a Type II error is then: β=P(p^<c∣p=pa)\beta = P(\hat{p} < c | p = p_a) This is calculated by standardizing cc using the distribution of p^\hat{p} under the assumption that p=pap = p_a: z=c−papa(1−pa)nz = \frac{c - p_a}{\sqrt{\frac{p_a(1 - p_a)}{n}}} So, β=P(Z<z)=Φ(c−papa(1−pa)n)\beta = P(Z < z) = \Phi\left(\frac{c - p_a}{\sqrt{\frac{p_a(1 - p_a)}{n}}}\right)

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 (nn) for a hypothesis test about a population mean (μ\mu) when σ\sigma is known, we consider the desired significance level α\alpha and the desired probability of a Type II error β\beta. 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∣\Delta = |\mu_a - \mu_0|.

For a two-tailed test, the formula for nn is: n=(zα/2+zβ)2σ2Δ2n = \frac{(z_{\alpha/2} + z_{\beta})^2 \sigma^2}{\Delta^2} where zα/2z_{\alpha/2} is the z-score for the significance level α\alpha in a two-tailed test, and zβz_{\beta} is the z-score for the probability of Type II error β\beta.

For a one-tailed test, the formula uses zαz_{\alpha} instead of zα/2z_{\alpha/2}: n=(zα+zβ)2σ2Δ2n = \frac{(z_{\alpha} + z_{\beta})^2 \sigma^2}{\Delta^2}

3.11 Sample size for a proportion

Similarly, for a hypothesis test about a population proportion (pp), the sample size nn can be determined. We need the desired significance level α\alpha, the desired probability of a Type II error β\beta, and the smallest difference in proportions we want to detect, Δ=∣pa−p0∣\Delta = |p_a - p_0|.

For a two-tailed test: n=(zα/2+zβ)2p0(1−p0)(pa−p0)2n = \frac{(z_{\alpha/2} + z_{\beta})^2 p_0(1 - p_0)}{(p_a - p_0)^2} When pap_a is not known, a conservative approach is to use p=0.5p = 0.5 in the (pa−p0)2(p_a - p_0)^2 term if p0p_0 is not 0.50.5. If pap_a is close to p0p_0, it might be better to use an estimate of pap_a.

For a one-tailed test: n=(zα+zβ)2p0(1−p0)(pa−p0)2n = \frac{(z_{\alpha} + z_{\beta})^2 p_0(1 - p_0)}{(p_a - p_0)^2}

The required sample size increases as the desired power (1−β1-\beta) increases and as the effect size (Δ\Delta) decreases.

3.12 Power of a test

The power of a hypothesis test is defined as 1−β1 - \beta, 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 (σ\sigma) or proportion (p0,pap_0, p_a): These are often estimated from previous studies, pilot studies, or based on expert judgment.
  • Effect size (Δ\Delta): This is the minimum difference that is considered practically significant.

These estimates are called "planning values."

3.14 Relationship between sample size, α\alpha, β\beta, and effect size

The choice of sample size is a trade-off between cost, time, and statistical rigor.

ParameterEffect
Sample Size (nn)Larger nn reduces both α\alpha and β\beta for a fixed effect size.
Significance Level (α\alpha)Increasing α\alpha reduces β\beta but increases Type I error probability.
Type II Error Prob (β\beta)Decreasing β\beta (increasing power) requires a larger nn for a fixed α\alpha and effect size.
Effect Size (Δ\Delta)Smaller effect sizes require larger nn 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−β1 - \beta) 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.

See also