4 comparing means-2
1. Introduction to statistical methods and hypothesis testing overview
This topic introduces the fundamental methodology for comparing the means of two independent populations, contrasting scenarios where population variances are assumed equal (pooled) versus unequal (unpooled), and outlining general course logistics and statistical tool selection.
1.1 Course Logistics and Statistical Tool Summary
The current focus of the course week involves hypothesis testing for two means (independent and paired) and understanding error types, power, and significance levels. A general statistical methodology table summarizes tests based on data type and assumptions, though this section primarily focuses on measurement data (means) for two independent sets 2 3.
1.2 Comparing Two Independent Population Means: Foundations
When comparing two independent populations, the interest lies in the difference between the population means, μ1−μ2, estimated by the sample mean difference, xˉ1−xˉ2. Assuming independence, the expectation of the difference in sample means is the difference in population means: mean(xˉ1−xˉ2)=μ1−μ2 6.
To conduct formal testing, we hypothesize about the difference μ0:
- Null Hypothesis: H0:μ1−μ2=μ0
- Alternative Hypotheses can be one-tailed (> or < ) or two-tailed (=) 8.
If population standard deviations (σ1,σ2) are known, a Z-statistic is used; otherwise, a T-statistic is employed, relying on the estimated standard error, SE(xˉ1−xˉ2) 7.
1.3 Hypothesis Testing with Unequal Variances (Unpooled Approach)
When population variances are assumed unequal (σ1=σ2), the standard error for the difference of means is estimated using individual sample variances (s12,s22):
t=n1s12+n2s22xˉ1−xˉ2−μ0
This test statistic follows an approximate t-distribution, whose degrees of freedom (n∗) must be calculated, as the exact degrees of freedom are complex.
The rejection rules for the two-tailed test are: Reject H0 if ∣t∣>tn∗,α/2 or if 2×Pr{Tn∗>∣t∣}≤α 10.
The calculation for the effective degrees of freedom (n∗) when variances are unequal is given by the Welch-Satterthwaite equation, and the result must be rounded to the nearest integer.

The confidence interval (CI) for μ1−μ2 when variances are unequal uses this calculated n∗:
(xˉ1−xˉ2)±tn∗,α/2n1s12+n2s22

Degrees of Freedom Options
There are three options for determining the degrees of freedom (n∗) when variances are unequal:
- Conservative Approach: n∗=min(n1−1,n2−1).
- Computed (Welch-Satterthwaite): Using the complex formula involving sample variances and sizes 9.
Example: For Municipality I (n1=25,s1=30) and Municipality II (n2=21,s2=18), the calculated degrees of freedom resulted in approximately 40.13, which is rounded to 40.

- Approximation: If both n1,n2>100, approximate using the Normal distribution (Z-distribution).
1.4 Hypothesis Testing with Equal Variances (Pooled Approach)
If we assume the population standard deviations are equal (σ1=σ2=σ), a stronger, pooled variance estimate (sp2) can be calculated. This leads to a pooled t-test, which follows an exact t-distribution with degrees of freedom df=n1+n2−215.
The pooled variance estimate is a weighted average of the sample variances: sp2=n1+n2−2(n1−1)s12+(n2−1)s22

The resulting pooled t-statistic is: t=spn11+n21xˉ1−xˉ2−μ0

A key difference from proportion testing is noted: pooling in means testing occurs if variances (σ's) are assumed equal, whereas in proportions, pooling often occurs if the null hypothesis (p1=p2) is assumed true 13.
The 100(1−α)% Confidence Interval based on the pooled variance assumption is: xˉ1−xˉ2±tn1+n2−2,α/2⋅spn11+n21 14.
1.5 Application Example: Utility Company Consumption
A utility company compares electricity consumption between two municipalities (I and II) 16.
| Municipality | Sample Mean (xˉ) | Standard Deviation (s) | Sample Size (n) |
|---|---|---|---|
| I | 115 dollars | 30 dollars | 25 |
| II | 98 dollars | 18 dollars | 21 |

Assumptions checked included independence, simple random sampling, and approximate normality, though histograms suggested some deviation from normality 17 18.
When testing for a difference (μ1−μ2=0) at α=0.05 using the unpooled approach (n∗=40 calculated ):
- The calculated t-statistic was compared against the critical value t0.025,40=2.021.
- Since the calculated t exceeded this critical value, there was evidence of a difference in average monthly bills 23.
Example: The calculation for the unpooled t-statistic leads to a result where the absolute value of t is greater than 2.021, leading to rejection of H0 22.

If the pooled approach were used (df=25+21−2=44), the conclusion generally remains similar, though the choice of df can affect tail probabilities. Given that the standard deviations (s1=30 vs s2=18) are quite different, the unpooled (Welch's) test is generally preferred unless prior reasons suggest equal variances exist.

Tip: When choosing between pooled and unpooled two-sample t-tests, if sample sizes are large, the difference in results is often small. However, if sample variances (s12 and s22) are substantially different, defaulting to the unpooled (Welch's) test is more robust due to its less restrictive assumptions 26.
2. Hypothesis testing for paired means in non-independent populations
This section details the methodology for performing a Matched Pairs t-Test (or Paired t-Test), which is essential for analyzing data where two dependent measurements are taken from the same subjects, such as before-and-after scenarios or when using matched individuals, thereby accounting for inherent variability between the paired units 28.
2.1 Motivation for using paired designs
When comparing two groups, such as American and Canadian manufacturing companies, simply comparing independent random samples can be problematic due to high variance caused by unmeasured confounding factors (e.g., company size, sector). A better approach involves matching companies based on relevant statistics and then analyzing the mean of the differences between these pairs 29.
Similarly, in contexts like weight loss clinics, comparing current clients to non-clients introduces sampling bias because those who join the clinic are already motivated regarding weight loss. The paired approach eliminates this by measuring each client's weight before and after a period of attendance, creating dependent measurements for each subject 30.
2.2 The Matched Pairs t-Test procedure
The paired t-test is fundamentally an application of the one-sample t-test performed on the differences between the paired observations, not the original measurements.
The structure of the data involves n subjects, each providing two linked measurements: "Before" (xi) and "After" (yi), from which a difference, di=xi−yi, is calculated for each subject i 31.
The formal hypothesis test setup is as follows:
- Null Hypothesis (H0): The true mean difference is zero, H0:μd=0.
- Alternative Hypothesis (Ha): The true mean difference is not zero, or directional (μd=0, μd>0, or μd<0).
The test statistic (tstat) is calculated using the sample mean difference (dˉ) and the standard deviation of the differences (sd) relative to the sample size (n): tstat=sd/ndˉ−0 The associated p-value is determined using the t-distribution with degrees of freedom df=n−1. For a two-sided test, the p-value is 2×Pr(T>∣tstat∣) 32.

Tip: When implementing this test in statistical software, it is crucial to select the appropriate option to calculate the test on the differences between Variable 1 and Variable 2, ensuring H0:μD=0 is tested, where μD=μ1−μ2 39.

2.3 Assumptions for the Paired t-Test
The validity of the paired t-test rests on specific assumptions that must be checked:
- Paired Data & Independence: The data must consist of two linked observations per individual, and the individuals themselves must be randomly selected (Simple Random Sample, SRS).
- Population Size: The sample size (n) should be small relative to the total population size (N), typically n<0.1×N.
- Normality of Differences: The histogram of the calculated differences (di) must be roughly Normal. It is the distribution of the differences, not the individual samples, that must satisfy this condition 35.
Example: In a learning evaluation example, the "Before" and "After" scores are paired data points from 20 students. We calculate the difference for each student (di=Post-test−Pre-test) and perform a one-sample t-test on these 20 difference scores 33.
For the learning evaluation example, given dˉ=1.45, sd=3.203, and n=20, testing H0:μd=0 versus Ha:μd>0: tstat=3.203/201.45−0≈2.02 Since t19,α=0.05=1.729, and 2.02>1.729, there is evidence at the 5% significance level to suggest that students' perception of learning improved after the midterm exam 34.
2.4 Application Example: Product Displays
Consider a manufacturer testing two point-of-purchase displays (A and B) across 15 randomly selected stores. Each store uses Display A for one week and Display B for another, recording sales each week. The goal is to determine if the display type impacts sales using α=0.05 36.
The observed data includes sales for A and B, and the calculated difference di (A - B) for 15 observations:

Summary statistics for the differences are calculated: n=15, dˉ=4.13, and sd=3.36 37.
For the test H0:μd=0 versus Ha:μd=0 at α=0.05: tstat=3.36/154.13≈4.77 The critical value is t14,α/2=0.025=2.145. Since 4.77>2.145, the null hypothesis is strongly rejected 38.
The conclusion is supported by a confidence interval for μd. If the 95% CI for μd is calculated to be between 2.27 and 5.99 sales/week, the fact that 0 does not fall within this interval confirms the rejection of H0:μd=0 41.
2.5 Warning against incorrect independent testing
A critical error occurs when the researcher fails to recognize that the data is paired and mistakenly applies an independent two-sample t-Test 42.
If the summary statistics for the two samples were calculated incorrectly as independent samples (xA=23.8,sA=12.33 and xB=20.33,sB=13.04), a two-sample test might lead to a conclusion that fails to reject the null hypothesis (μA−μB=0).

The paired t-test is more powerful because it isolates and estimates the variability between the displays while effectively controlling for the high variability within the samples (e.g., inherent sales fluctuations between different stores). Failing to account for the pairing reduces the power of the test and can lead to incorrect conclusions, as seen when the paired test rejects the null while the independent test supports it 43.
3. Summary of statistical tests and introduction to error types
This section summarizes the hypothesis tests covered for means and proportions, details the conditions for their application, and introduces the critical concepts of Type I and Type II errors in hypothesis testing.
3.1 Review of Hypothesis Tests for Means and Proportions
The foundational requirement for performing tests on means is that the sampling distribution of the sample mean, xˉ, must be Normal. This condition is satisfied either when the population distribution is Normal or when the sample size (n) is large enough (Central Limit Theorem) 46.
Specific tests reviewed include:
- One-sample z-test: Used when the population standard deviation (σ) is known. The test statistic follows a standard Normal distribution, Z∼N(0,1), calculated as: zstat=σ/nxˉ−μ
- One-sample t-test: Used when the population standard deviation (σ) is unknown, necessitating the use of the sample standard deviation (s).
The summary moves on to compare two samples, covering dependent and independent scenarios:
- Paired t-test: Utilized when there are two dependent observations per subject (e.g., before-and-after measurements) to compare the mean difference.
- Two-sample t-test: Used to compare the means of two independent populations.
- Pooled two-sample t-test: A specific version of the two-sample t-test requiring the additional assumption that the standard deviations in both populations are equal.
The calculation of test statistics for paired and two-sample t-tests are summarized by their respective formulas:

Tip: When dealing with dependent samples (paired data), the paired t-test analyzes the mean difference (dˉ) directly, effectively reducing the two-sample problem to a one-sample problem on the differences.
3.2 Interpretation and Caveats of Hypothesis Tests
A statistical test assesses the evidence against the null hypothesis (H0), but it is crucial to understand its limitations regarding study design and practical relevance.
Key considerations when interpreting hypothesis tests:
- The test cannot correct for a flawed study design.
- Random sampling is a necessary prerequisite for valid inference.
- Statistical significance (small p-value) indicates a real effect beyond sampling variation. Practical significance assesses whether this effect has a meaningful real-world impact, often supported by examining confidence intervals 51.
- Always check for outliers, as they can unduly influence results.
- A non-significant result must not be ignored; it might indicate a practically important difference that was missed due to measurement issues or low statistical power.
- Researchers must guard against "searching for statistical significance" or conducting tests with inherently low power, which is defined as the probability of correctly rejecting a false null hypothesis 52.
3.3 Types of Errors in Hypothesis Testing
Hypothesis testing involves drawing conclusions based on sample data, which inherently carries the risk of making incorrect decisions regarding the true state of the population. There are two primary ways a conclusion can be wrong.
These potential errors are mapped out in the decision matrix:

The two types of errors are formally defined:
- Type I Error (α, False Positive): Occurs when the researcher rejects the null hypothesis (H0) when it is actually true. The probability of committing this error is denoted by α (the significance level).
- Type II Error (β, False Negative): Occurs when the researcher fails to reject the null hypothesis (H0) when it is actually false. The probability of this error is denoted by β.
The correct decisions in hypothesis testing are:
- Correct Decision (Accepting H0): Failing to reject H0 when H0 is true, with probability 1−α.
- Power (1−β): Correctly rejecting H0 when H0 is false. Increasing power is a primary goal in study design 53.
Example: In a legal setting where H0: A defendant is not guilty:
- Type I Error: Convicting an innocent person (rejecting a true H0).
- Type II Error: Letting a guilty person go free (failing to reject a false H0) 54.
3.4 Summary of Appropriate Statistical Tests
The selection of the appropriate test depends fundamentally on the nature of the data (Measurement vs. Categorical) and whether the assumption of Normality can be reasonably made 55.
The decision table organizes the appropriate statistical procedures based on these criteria:

For Measurement Data under the assumption of normality:
- One sample: One sample t-test or z-test (if population SD is known).
- Two independent samples: Two-sample t-test (pooled or unpooled).
- Two dependent samples: Matched pairs test.
For Categorical Data, tests focus on proportions:
- One sample: One sample proportion test.
- Two independent samples: Two sample proportion test (pooled or unpooled, depending on covariance assumptions).
- Two dependent samples: Two sample proportion test with non-zero covariance, or the Binomial test. </document_content>
Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
© 2026 Maeve. All rights reserved. This content is protected by copyright.