STAT 3011 Fall 2026: Statistical Inference on Matched Pairs
Overview
Prof Kazeem Adepoju explains matched-pairs inference as a comparison of measurements from the same subjects on two occasions, reducing each pair to a difference and analyzing the differences with a one-sample t procedure. He demonstrates confidence intervals and hypothesis tests, including the standard error, degrees of freedom, direction of the alternative hypothesis, and R functions such as `qt`, `pt`, and `t.test`, while contrasting paired data with independent groups.
Key takeaways
- Matched-pairs inference analyzes one difference per subject or matched unit, such as each patient's before-minus-after blood pressure, rather than treating the two measurements as independent samples.
- For n paired differences, the paired t standard error is s_D/√n and the degrees of freedom are n − 1.
- A paired t confidence interval uses the mean difference ± t* × s_D/√n; in R, `qt(1 - alpha/2, n - 1)` supplies the two-sided critical value.
- The order used to subtract paired measurements determines the signs of the mean difference, confidence limits, and directional alternative hypothesis.
- A paired t test uses H₀: μ_D = 0; reject the null when the p-value is below the stated significance level, such as 0.01 in the BAC example.
- Use `t.test` with `paired = TRUE` for repeated measurements on the same subjects; measurements from separate vaccine and placebo groups require an independent-groups method.
Chapters
- Prof Kazeem Adepoju shifts from earlier work on differences in proportions to comparing two means.
- The central distinction is whether measurements come from the same subjects on two occasions or from separate groups.
- The lesson covers both confidence intervals and hypothesis tests for matched-pair differences.
- Blood pressure measured on the same patients before and after medication forms matched pairs.
- Exam 1 and Exam 2 scores from the same students, or worker output before and after incentives, are also paired examples.
- Comparing spring and winter yields from the same farm locations is paired because each location is measured in both seasons.
- Assign paired measurements labels such as before X and after Y, then calculate one difference D for each subject.
- The sample mean of the differences summarizes the average change; the standard deviation of the differences describes their variability.
- For n paired observations, the standard error is s_D divided by the square root of n, and the t procedure uses n minus 1 degrees of freedom.
- The confidence interval is the mean difference plus or minus a t critical value multiplied by the standard error.
- In R, obtain the critical value with `qt(1 - alpha/2, df)`; for a 95% interval, alpha is 0.05.
- The degrees of freedom are the number of paired differences minus one because the critical value comes from a t distribution.
- The example compares spring and winter harvests at 20 locations, with each location contributing one paired difference.
- Using spring minus winter gives a reported mean difference of 29.2; the example's 95% interval is approximately 24.82 to 33.58.
- A positive interval supports higher spring yield under the chosen subtraction order; reversing the order would reverse the sign.
- The paired t method assumes independent, randomly sampled pairs and, for small samples, an approximately normal distribution of differences without strong skew or outliers.
- The same patients measured before and after treatment are dependent observations and should be analyzed as pairs.
- A vaccine group and a placebo group made up of different people are independent, not matched pairs.
- The test and interval concern the mean of the within-pair differences, not two unrelated sample means.
- The null hypothesis is H₀: μ_D = 0, meaning no population mean change under the defined subtraction order.
- Choose Hₐ: μ_D < 0, μ_D > 0, or μ_D ≠ 0 to match the research question.
- The test statistic is the sample mean difference minus the null value, divided by s_D/√n; the t distribution uses n minus 1 degrees of freedom.
- For before-and-after data, define which measurement is subtracted first before interpreting the sign of the result.
- Six adults have blood alcohol content measured at sea level and high altitude, producing six paired differences.
- The research question asks whether the mean BAC is lower at sea level, so the alternative is one-sided and must reflect the chosen difference order.
- The example uses a 1% significance level and compares the p-value with 0.01 to decide whether to reject H₀.
- For a one-sided test in R, `pt` uses the calculated t statistic and 5 degrees of freedom to obtain the p-value.
- Arrange the two measurements as paired vectors and set `paired = TRUE` in R's `t.test` function.
- Set `alternative` to `less`, `greater`, or `two.sided` according to the research question; use `conf.level = 0.95` for a 95% interval.
- The test output reports the t statistic, degrees of freedom, and p-value; the confidence interval output gives lower and upper bounds.
- The lesson closes by contrasting paired comparisons, such as the same class's Exam 1 and Exam 2 scores, with independent comparisons between different classes.
Transcript excerpt
0:06 I can't take off. >> Oh, okay. [laughter] Okay. Uh, >> good day everyone. I want to welcome you to another statistical >> analysis class. >> Of course, gradually >> we moving to the end of the semester. We moving gradually
0:53 to final exam. Um we currently grading exam too and of course some results will be going out today. So, make sure you watch out. >> Want to welcome you back from Thanksgiving break and of course uh it's back to business as usual. >> Okay. >> Um before the Thanksgiving break, we started comparing two groups >> and I remember we did um you know um difference of proportions. We constructed confidence interval about difference of proportions. We also tested hypothesis you know uh on difference of
1:42 proportions. We want to move away from difference of proportion. We want to want to focus on means but we got two groups. We'll be focusing on means we got two two groups. Okay. And I want to welcome you to comparing two means. But we have different way of doing this depending on whether we actually are using a match PS or we using independent groups. What we want to focus on today is a situation where uh we visited the same subject in two occasions.
2:28 I'm going to say that again. We visited the same subjects in two different occasion. Let me do this. So today we want to focus on match pier like I said and I need you to pay attention to what I mean by mash peers. Okay, we actually going to construct confidence interval about this. We're also going to test hypothesis about this. Well, let me give you um different scenario that will you know that will lead us into this. Let's say for instance
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Prof Kazeem Adepoju.