psbe5e lectureslides ch08

Table of contents

  1. Inference for the mean of a population
  2. Comparing two means
  3. Additional topics on inference

1. Inference for the mean of a population

1.1 The t distributions

When the population standard deviation σ\sigma is unknown, the sampling distribution of the sample mean xˉ\bar{x} follows a t distribution. This distribution is used for inference about the population mean μ\mu when σ\sigma is estimated by the sample standard deviation ss.

The t distribution is characterized by its degrees of freedom (df), which is typically n−1n-1 for a sample of size nn.

  • t distribution: A probability distribution used for inference when σ\sigma is unknown.
  • Degrees of freedom (df): For a one-sample t-procedure, df = n−1n-1.
  • Shape of t distributions: They are bell-shaped and symmetric around 0, similar to the standard Normal distribution. However, t distributions have heavier tails, meaning they have more probability in the tails than the Normal distribution. This reflects the increased uncertainty due to estimating σ\sigma with ss.
  • Effect of degrees of freedom: As the degrees of freedom increase, the t distribution becomes closer to the standard Normal distribution. For very large sample sizes, the t distribution is virtually indistinguishable from the Normal distribution.

A t-distribution curve with the area to the left of 2.306 shaded, representing a cumulative probability.

1.2 The one-sample t confidence interval

A confidence interval provides a range of plausible values for the population mean μ\mu when σ\sigma is unknown. The general form of a t confidence interval is the sample mean plus or minus a margin of error.

  • Confidence interval formula: xˉ±m\bar{x} \pm m, where mm is the margin of error.
  • Margin of error (m): m=t∗snm = t^\ast \frac{s}{\sqrt{n}}, where t∗t^\ast is the critical value from the t distribution with n−1n-1 degrees of freedom corresponding to the desired confidence level CC.
  • Finding the critical value (t∗t^\ast): The value t∗t^\ast is found using a t-distribution table (Table D) or a calculator, based on the degrees of freedom (n−1n-1) and the confidence level (CC). The area between −t∗-t^\ast and t∗t^\ast is equal to CC.

Red wine, in moderation (1 of 2) A study on nine healthy men drinking half a bottle of red wine daily for two weeks measured the percent change in blood polyphenol levels. The data were considered reasonably Normal despite the small sample size.

Red wine, in moderation (2 of 2) For this study, the sample average percent change was 5.5% with a sample standard deviation s=2.517s = 2.517. With n=9n=9, the degrees of freedom are df=9−1=8df = 9-1 = 8. The 95% confidence interval for the average percent increase is calculated as 5.5±1.935.5 \pm 1.93. This means that with 95% confidence, the population average percent increase in polyphenol blood levels for men drinking this amount of red wine daily is between 3.6% and 7.4%.

1.3 The one-sample t test

A one-sample t test is used to test hypotheses about a population mean μ\mu when σ\sigma is unknown. The procedure involves stating hypotheses, choosing a significance level, calculating a test statistic, and determining a P-value.

  • Hypotheses:
  • Null hypothesis (H0H_0): Typically states that the population mean is equal to a specific value (μ=μ0\mu = \mu_0).
  • Alternative hypothesis (HaH_a): States that the population mean is greater than, less than, or not equal to μ0\mu_0.
  • Test statistic (t): t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}, calculated using the sample mean xˉ\bar{x}, the hypothesized population mean μ0\mu_0, the sample standard deviation ss, and the sample size nn.
  • P-value: The probability of observing a test statistic as extreme as, or more extreme than, the one calculated, assuming the null hypothesis is true. The P-value is determined by the area under the t distribution curve with n−1n-1 degrees of freedom.
  • Decision: If the P-value is less than the significance level α\alpha, reject H0H_0. Otherwise, fail to reject H0H_0.

This diagram illustrates the concepts of one-sided and two-sided hypothesis testing, showing the relationship between the alternative hypothesis (Ha), the probability of the test statistic (T), and the corresponding regions under a normal distribution curve.

Sweetening colas (2 of 3) Cola manufacturers tested if storage resulted in sweetness loss (H0:μ=0H_0: \mu = 0 vs. Ha:μ>0H_a: \mu > 0) at a 0.05 significance level. The P-value was found to be 0.0122. Since 0.0122<0.050.0122 < 0.05, H0H_0 is rejected, indicating a significant average loss of sweetness after storage.

A t-distribution curve with shaded area representing the probability for a given value and degrees of freedom.

This chart displays a t-distribution with 9 degrees of freedom, highlighting the probabilities outside the bounds of -2.7 and 2.7.

1.4 Matched pairs t procedures

Matched pairs t procedures are used when the data consist of two related samples, such as measurements taken on the same subjects before and after a treatment, or measurements on matched pairs of subjects. The analysis focuses on the differences between the paired observations.

  • Paired data: Observations that are linked or related in some way (e.g., before/after measurements on the same individual).
  • Difference variable: A new variable is created by calculating the difference between the paired observations for each pair (Xdifference=X1−X2X_{difference} = X_1 - X_2).
  • Hypotheses: The hypotheses are formulated in terms of the mean difference (μdifference\mu_{difference}).
  • H0:μdifference=0H_0: \mu_{difference} = 0
  • Ha:μdifference>0H_a: \mu_{difference} > 0, μdifference<0\mu_{difference} < 0, or μdifference≠0\mu_{difference} \neq 0.
  • Procedure: The matched pairs t-test is essentially a one-sample t-test performed on the differences. The degrees of freedom are n−1n-1, where nn is the number of pairs.

Sweetening colas (3 of 3) For 10 tasters, sweetness loss was evaluated by comparing sweetness before and after storage. The differences in sweetness were analyzed using a matched pairs t-test, with hypotheses H0:μBefore−After=0H_0: \mu_{Before-After} = 0 versus Ha:μBefore−After>0H_a: \mu_{Before-After} > 0.

This is treated as a one-sample test on the difference scores.

Does lack of caffeine increase depression? (1 of 4) A study investigated if caffeine deprivation increases depression. Participants diagnosed with caffeine dependence received pills containing either caffeine or a placebo.

Depression scores were assessed, and the analysis focused on the difference in depression scores (placebo minus caffeine) for each subject.

Does lack of caffeine increase depression? (2 of 4) With 11 participants, the degrees of freedom for the matched pairs t-test are df=11−1=10df = 11-1 = 10. The sample mean difference was xˉ=7.36\bar{x} = 7.36 with a sample standard deviation s=6.92s = 6.92. The hypotheses were H0:mdifference=0H_0: m_{difference} = 0 and Ha:mdifference>0H_a: m_{difference} > 0.

The P-value was calculated as 0.0032. This indicates a significantly higher depression level when individuals were deprived of caffeine.

This chart displays a t-distribution curve with the degrees of freedom set to 9, illustrating the probability of a value being greater than 3.53.

1.5 Equivalence

Equivalence testing aims to determine if a parameter (like a population mean) is "equivalent" to a reference value within a specified margin of error. This is often done by constructing a confidence interval and checking if it falls entirely within the equivalence margin.

  • Equivalence margin: A range defined as μ0±m\mu_0 \pm m, where μ0\mu_0 is the reference value and mm is the margin of error for equivalence.
  • Procedure:
  1. Construct a confidence interval for the population mean μ\mu with a confidence level C=1−2αC = 1 - 2\alpha.
  2. Compare this confidence interval to the equivalence margin μ0±m\mu_0 \pm m.
  3. If the entire confidence interval lies within μ0±m\mu_0 \pm m, conclude that μ\mu is equivalent to μ0\mu_0. Otherwise, conclude that μ\mu is not equivalent to μ0\mu_0.

Software parameters GE Healthcare researchers wanted to know if a new measurement software setting resulted in a mean difference of less than 0.25 microns compared to the old setting. A 90% confidence interval for the mean difference was found to be (−0.089,0.143)(-0.089, 0.143). Since this interval is entirely within the equivalence margin of 0±0.250 \pm 0.25, the researchers can conclude that the two means are equivalent at a 95% confidence level (corresponding to α=0.05\alpha = 0.05 for a 1−2α1-2\alpha confidence level).

1.6 Robustness of t procedures

The t procedures (confidence intervals and hypothesis tests) are considered robust to violations of the Normality assumption, especially with larger sample sizes. However, certain conditions must be met for the procedures to remain reliable.

  • Random sampling: The data must come from a Simple Random Sample (SRS) from the population.
  • Outliers and skewness: These can strongly influence the mean and thus affect t procedures.
  • n < 15: Data should be close to Normal and have no outliers.
  • 15 ≤ n < 40: Mild skewness is acceptable, but outliers should be avoided.
  • n ≥ 40: The t statistic is generally valid even with strong skewness due to the Central Limit Theorem.

Comparison of a large sample distribution and a small sample distribution against a population distribution.

2. Comparing two means

2.1 Two-sample problems

When comparing the means of two groups, we collect data from random samples of each population. The goal is to determine if observed differences in sample means are due to random variation or a true difference in population means.

This comparison can be made using a confidence interval for the difference between population means or by testing the hypothesis that the population means are equal.

2.2 Two-sample z statistic

For two independent simple random samples (SRSs) from populations with means μ1\mu_1 and μ2\mu_2 and standard deviations σ1\sigma_1 and σ2\sigma_2, the difference between sample means, xˉ1−xˉ2\bar{x}_1 - \bar{x}_2, estimates μ1−μ2\mu_1 - \mu_2. If both populations are normally distributed, the sampling distribution of xˉ1−xˉ2\bar{x}_1 - \bar{x}_2 is normal with mean μ1−μ2\mu_1 - \mu_2.

The standard deviation of this sampling distribution is: σxˉ1−xˉ2=σ12n1+σ22n2\sigma_{\bar{x}_1 - \bar{x}_2} = \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}} The two-sample z statistic, z=(xˉ1−xˉ2)−(μ1−μ2)σ12n1+σ22n2z = \frac{(\bar{x}_1 - \bar{x}_2) - (\mu_1 - \mu_2)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}, follows a standard Normal distribution, N(0, 1).

2.3 Two independent samples t distribution

When population standard deviations σ1\sigma_1 and σ2\sigma_2 are unknown, we use sample standard deviations s1s_1 and s2s_2 to estimate them. For two independent SRSs from two distinct populations, the two-sample t statistic is used for inference about the difference in population means, μ1−μ2\mu_1 - \mu_2.

The standard error (SE) of the difference between sample means is: SE=s12n1+s22n2SE = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} This statistic follows approximately a t distribution. The degrees of freedom (df) can be conservatively estimated as the smaller of (n1−1)(n_1 - 1) and (n2−1)(n_2 - 1).

More sophisticated approximations, like the Satterthwaite approximation, are often used by statistical software.

A t-distribution curve is shown, illustrating the concept of degrees of freedom and a formula related to sample variances and sizes.

2.4 Two-sample t confidence interval

A confidence interval for the difference between two population means, μ1−μ2\mu_1 - \mu_2, is constructed using the difference between sample means, xˉ1−xˉ2\bar{x}_1 - \bar{x}_2, as the point estimate. The general form of the confidence interval is: (xˉ1−xˉ2)±t∗SE(\bar{x}_1 - \bar{x}_2) \pm t^\ast SE where t∗t^\ast is the critical value from the t distribution corresponding to the desired confidence level (C) and the calculated degrees of freedom.

The margin of error (m) is t∗SEt^\ast SE. The value of t∗t^\ast is found using a t-distribution table, looking for the row corresponding to the degrees of freedom and the column for the confidence level.

2.5 Real-time spending feedback on shopping carts (1 of 3)

A study investigated whether real-time feedback on spending affects consumer behavior. Participants were given 35tospendinanonlinegrocerystore,withsomereceivingimmediateelectronicspendingfeedbackandothersnot.Thestudyaimedtoestimatethedifferenceinaveragespendingbetweenthesetwogroups.Theconfidenceintervalforthedifferenceinpopulationmeans35 to spend in an online grocery store, with some receiving immediate electronic spending feedback and others not. The study aimed to estimate the difference in average spending between these two groups. The confidence interval for the difference in population means (\mu_1 - \mu_2)$ was calculated as 2.822±2.7552.822 \pm 2.755, indicating that with 95% confidence, the true difference in spending falls between $0.07 and $5.58.

2.6 Two-sample t test

A two-sample t test is used to test the hypothesis that two population means are equal. The null hypothesis is typically stated as H0:μ1=μ2H_0: \mu_1 = \mu_2, which is equivalent to H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0.

The alternative hypothesis can be one-sided (Ha:μ1>μ2H_a: \mu_1 > \mu_2 or Ha:μ1<μ2H_a: \mu_1 < \mu_2) or two-sided (Ha:μ1≠μ2H_a: \mu_1 \neq \mu_2).

The test statistic is calculated by standardizing the difference between sample means: t=(xˉ1−xˉ2)−(μ1−μ2)SEt = \frac{(\bar{x}_1 - \bar{x}_2) - (\mu_1 - \mu_2)}{SE} Under the null hypothesis, where μ1−μ2=0\mu_1 - \mu_2 = 0, the formula simplifies to: t=xˉ1−xˉ2SEt = \frac{\bar{x}_1 - \bar{x}_2}{SE} This t statistic follows a t distribution with the appropriate degrees of freedom.

2.7 Real-time spending feedback on shopping carts (2 of 3)

This section applies the two-sample t test to the real-time spending feedback study. The research question is whether there is a significant difference in average spending between participants who received real-time feedback and those who did not.

The hypotheses are set up as: H0:μ1=μ2H_0: \mu_1 = \mu_2 (The average spending is the same for both groups) Ha:μ1≠μ2H_a: \mu_1 \neq \mu_2 (The average spending is different for the two groups)

2.8 Real-time spending feedback on shopping carts (3 of 3)

For the real-time spending feedback study, with H0:μ1=μ2H_0: \mu_1 = \mu_2 and Ha:μ1≠μ2H_a: \mu_1 \neq \mu_2, the calculated t statistic was found using 40 degrees of freedom. The p-value was determined to be between 0.04 and 0.05 (0.04≤2P(T≥2.07)≤0.050.04 \le 2 P(T \ge 2.07) \le 0.05). Since this p-value is less than the typical significance level of 0.05, the null hypothesis is rejected.

The data suggest that consumers on a budget tend to spend more when provided with real-time spending feedback.

2.9 Robustness

The two-sample t procedures are generally more robust to violations of the normality assumption than one-sample t procedures. Robustness is enhanced when both sample sizes are equal and the distributions of the two populations are similar in shape.

Even with deviations from these ideal conditions, two-sample tests often remain reliable.

For planning purposes, choosing equal sample sizes for both groups is recommended. A guideline suggests that a combined sample size of 40 or more can provide robustness even with distributions that are clearly skewed.

This table presents statistical data for two groups, one with feedback and one without, showing sample size (n), mean (x̄), and standard deviation (s).

ConditionEffect on Robustness
Equal sample sizesIncreases robustness
Similar distribution shapesIncreases robustness
Combined sample size ≥\ge 40Allows use with skewed distributions

3. Additional topics on inference

3.1 Choosing the sample size

The sample size for a confidence interval for a mean can be determined to achieve a desired margin of error (mm). This calculation involves an initial estimate of the population standard deviation (s∗s^\ast) and a critical value. Since the exact critical value (t∗t^\ast) depends on the sample size (nn), which is unknown, an iterative process is often used.

  • Initial estimate: Replace t∗t^\ast with the critical value for a z-test (z∗z^\ast) and calculate an initial sample size.
  • Refinement: Use the initial sample size to find a more accurate t∗t^\ast value. If this value leads to a margin of error greater than the desired mm, increase nn by 1 and repeat the process until the margin of error is acceptable.

The guessed value for the population standard deviation (s∗s^\ast) is often based on pilot studies or previous research. It is advisable to use a slightly larger estimate for s∗s^\ast to ensure sufficient sample size and avoid underestimating the required data.

3.2 Power of the t test

The power of a statistical test is the probability that it correctly rejects the null hypothesis when a specific alternative hypothesis is true. For a one-sample t-test, power is calculated against a specific alternative value of the population mean (μ\mu).

  • Significance level (α\alpha): This is the probability of a Type I error (rejecting the null hypothesis when it is actually true).
  • Alternative hypothesis: This specifies the true value of the population mean that the test aims to detect.

Calculating the exact power of a t-test can be complex, often involving the noncentral t-distribution. However, an approximate calculation, treating the population standard deviation (σ\sigma) as known, is generally sufficient for study planning.

When estimating σ\sigma, it is prudent to err on the side of a larger value to ensure adequate sample size and avoid missing a real effect.

3.3 Power of the two-sample t test

The power of a two-sample t-test measures the probability of correctly rejecting the null hypothesis when there is a specific difference between two population means (μ1−μ2\mu_1 - \mu_2). Similar to the one-sample t-test, this calculation is complex and typically relies on the noncentral t-distribution.

  • Study planning: Software is used to perform these calculations, which are essential for planning studies.
  • Information needed: To determine the necessary sample size for adequate power, information from pilot studies or prior research is required to estimate expected values.

3.4 Type I and Type II errors

Statistical hypothesis testing involves the risk of making two types of errors:

  • Type I error: Rejecting the null hypothesis when it is actually true. The probability of a Type I error is equal to the significance level (α\alpha) of the test.
  • Type II error: Failing to reject the null hypothesis when it is false. The probability of a Type II error is denoted by β\beta.

The power of a test is the complement of the probability of a Type II error (1−β1 - \beta). Therefore, a higher power means a lower probability of a Type II error.

Comparison of the normal distribution N(0,1) with two t-distributions, t(15) and t(5).

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also