psbe5e lectureslides ch08
Table of contents
- Inference for the mean of a population
- Comparing two means
- Additional topics on inference
1. Inference for the mean of a population
1.1 The t distributions
When the population standard deviation σ is unknown, the sampling distribution of the sample mean xˉ follows a t distribution. This distribution is used for inference about the population mean μ when σ is estimated by the sample standard deviation s.
The t distribution is characterized by its degrees of freedom (df), which is typically n−1 for a sample of size n.
- t distribution: A probability distribution used for inference when σ is unknown.
- Degrees of freedom (df): For a one-sample t-procedure, df = n−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 σ with s.
- 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.

1.2 The one-sample t confidence interval
A confidence interval provides a range of plausible values for the population mean μ when σ 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, where m is the margin of error.
- Margin of error (m): m=t∗ns, where t∗ is the critical value from the t distribution with n−1 degrees of freedom corresponding to the desired confidence level C.
- Finding the critical value (t∗): The value t∗ is found using a t-distribution table (Table D) or a calculator, based on the degrees of freedom (n−1) and the confidence level (C). The area between −t∗ and t∗ is equal to C.
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.517. With n=9, the degrees of freedom are df=9−1=8. The 95% confidence interval for the average percent increase is calculated as 5.5±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 μ when σ is unknown. The procedure involves stating hypotheses, choosing a significance level, calculating a test statistic, and determining a P-value.
- Hypotheses:
- Null hypothesis (H0): Typically states that the population mean is equal to a specific value (μ=μ0).
- Alternative hypothesis (Ha): States that the population mean is greater than, less than, or not equal to μ0.
- Test statistic (t): t=s/nxˉ−μ0, calculated using the sample mean xˉ, the hypothesized population mean μ0, the sample standard deviation s, and the sample size n.
- 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−1 degrees of freedom.
- Decision: If the P-value is less than the significance level α, reject H0. Otherwise, fail to reject H0.

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


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−X2).
- Hypotheses: The hypotheses are formulated in terms of the mean difference (μdifference).
- H0:μdifference=0
- Ha:μdifference>0, μdifference<0, or μdifference=0.
- Procedure: The matched pairs t-test is essentially a one-sample t-test performed on the differences. The degrees of freedom are n−1, where n 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=0 versus Ha:μ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=10. The sample mean difference was xˉ=7.36 with a sample standard deviation s=6.92. The hypotheses were H0:mdifference=0 and Ha:mdifference>0.
The P-value was calculated as 0.0032. This indicates a significantly higher depression level when individuals were deprived of caffeine.

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, where μ0 is the reference value and m is the margin of error for equivalence.
- Procedure:
- Construct a confidence interval for the population mean μ with a confidence level C=1−2α.
- Compare this confidence interval to the equivalence margin μ0±m.
- If the entire confidence interval lies within μ0±m, conclude that μ is equivalent to μ0. Otherwise, conclude that μ is not equivalent to μ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). Since this interval is entirely within the equivalence margin of 0±0.25, the researchers can conclude that the two means are equivalent at a 95% confidence level (corresponding to α=0.05 for a 1−2α 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.

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 and μ2 and standard deviations σ1 and σ2, the difference between sample means, xˉ1−xˉ2, estimates μ1−μ2. If both populations are normally distributed, the sampling distribution of xˉ1−xˉ2 is normal with mean μ1−μ2.
The standard deviation of this sampling distribution is: σxˉ1−xˉ2=n1σ12+n2σ22 The two-sample z statistic, z=n1σ12+n2σ22(xˉ1−xˉ2)−(μ1−μ2), follows a standard Normal distribution, N(0, 1).
2.3 Two independent samples t distribution
When population standard deviations σ1 and σ2 are unknown, we use sample standard deviations s1 and s2 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.
The standard error (SE) of the difference between sample means is: SE=n1s12+n2s22 This statistic follows approximately a t distribution. The degrees of freedom (df) can be conservatively estimated as the smaller of (n1−1) and (n2−1).
More sophisticated approximations, like the Satterthwaite approximation, are often used by statistical software.

2.4 Two-sample t confidence interval
A confidence interval for the difference between two population means, μ1−μ2, is constructed using the difference between sample means, xˉ1−xˉ2, as the point estimate. The general form of the confidence interval is: (xˉ1−xˉ2)±t∗SE where t∗ 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∗SE. The value of t∗ 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.Theconfidenceintervalforthedifferenceinpopulationmeans(\mu_1 - \mu_2)$ was calculated as 2.822±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=μ2, which is equivalent to H0:μ1−μ2=0.
The alternative hypothesis can be one-sided (Ha:μ1>μ2 or Ha:μ1<μ2) or two-sided (Ha:μ1=μ2).
The test statistic is calculated by standardizing the difference between sample means: t=SE(xˉ1−xˉ2)−(μ1−μ2) Under the null hypothesis, where μ1−μ2=0, the formula simplifies to: t=SExˉ1−xˉ2 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=μ2 (The average spending is the same for both groups) Ha:μ1=μ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=μ2 and Ha:μ1=μ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.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.

| Condition | Effect on Robustness |
|---|---|
| Equal sample sizes | Increases robustness |
| Similar distribution shapes | Increases robustness |
| Combined sample size ≥ 40 | Allows 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 (m). This calculation involves an initial estimate of the population standard deviation (s∗) and a critical value. Since the exact critical value (t∗) depends on the sample size (n), which is unknown, an iterative process is often used.
- Initial estimate: Replace t∗ with the critical value for a z-test (z∗) and calculate an initial sample size.
- Refinement: Use the initial sample size to find a more accurate t∗ value. If this value leads to a margin of error greater than the desired m, increase n by 1 and repeat the process until the margin of error is acceptable.
The guessed value for the population standard deviation (s∗) is often based on pilot studies or previous research. It is advisable to use a slightly larger estimate for s∗ 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 (μ).
- Significance level (α): 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 (σ) as known, is generally sufficient for study planning.
When estimating σ, 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). 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 (α) 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 β.
The power of a test is the complement of the probability of a Type II error (1−β). Therefore, a higher power means a lower probability of a Type II error.

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