STAT 3011 Fall 2026: Two- Sample t Test for independent samples
Overview
Prof. Kazeem Adepoju explains how to test whether two independent population means differ, connecting the method to vaccine-versus-placebo comparisons and sentencing disparities. He covers directional hypotheses, assumptions, unequal- and equal-variance standard errors, degrees of freedom, p-values, and R, then works through examples with 44 students per group and a study-method comparison using pooled variance.
Key takeaways
- A two-sample t-test compares means from independent groups, unlike a paired t-test, which analyzes before-and-after measurements from the same participants.
- The research question determines the alternative: “lower” gives a left-tailed test, “higher” gives a right-tailed test, and “different” gives a two-tailed test.
- For equal population variances, pool the sample variances and use degrees of freedom n₁ + n₂ - 2; the study-method example has 36 students per group and 83 degrees of freedom.
- For a right-tailed test in R, calculate the upper-tail probability with 1 - pt(t, df); a left-tailed test uses pt(t, df).
- A p-value below alpha leads to rejection of the null and evidence supporting the alternative, but failing to reject the null does not prove the population means are exactly equal.
- R's t.test function can automate the statistic, degrees of freedom, and p-value calculations; the var.equal setting must reflect the variance assumption used.
Chapters
- Adepoju distinguishes Monday's paired design, measuring antibodies in the same vaccine participants before and after vaccination, from comparing separate groups.
- Wednesday's vaccine-versus-placebo example compared two sample means and used a confidence interval to estimate the size, direction, and precision of the difference.
- The class shifts from estimating a difference with an interval to testing whether the difference between independent means is statistically significant.
- A legal-system example compares average sentence lengths for two racial groups, with cases matched on offense and similar circumstances.
- The null hypothesis states that the population means are equal; the alternative can specify a lower mean, a higher mean, or any difference.
- A less-than or greater-than alternative is a one-tailed test with a direction, while a not-equal alternative is a nondirectional, two-tailed test.
- The samples must be independent, and observations within each group must also be independent.
- For small samples, the lecture requires normal populations; when normality is questionable, it recommends at least 30 observations in each group.
- For unequal population variances, the standard error uses each group's sample variance and sample size rather than a pooled variance.
- Adepoju presents unequal variances as the default course assumption when a problem does not specify that population variances are equal.
- The p-value depends on the observed t statistic, its degrees of freedom, and the direction specified by the alternative hypothesis.
- For unequal variances, Adepoju uses the smaller of the two individual degrees of freedom; the equal-variance method uses a different calculation.
- A left-tailed test uses the lower-tail probability, a right-tailed test uses the upper-tail probability, and a two-tailed test accounts for both tails.
- Compare the p-value with alpha: reject the null when p is below alpha, and otherwise fail to reject it.
- The example compares verbal scores from 44 engineering students and 44 literature students, with sample standard deviations of 42 for engineering and a separately supplied value for literature.
- The question asks whether engineering majors have a lower mean score, so the alternative is μengineering < μliterature.
- With no equal-variance assumption stated, the lecture applies the unequal-variance standard error and uses 43 degrees of freedom.
- Adepoju reports a t-statistic magnitude of about 9.35 and a p-value of about 0.001; against α = 0.01, the class rejects the null and concludes there is evidence of a lower engineering mean.
- The direction of the alternative comes from the research wording: “lower” means a left-tailed test, while “higher” means a right-tailed test.
- The null hypothesis uses equality, while the alternative changes according to the research question.
- A statistically significant result supports the stated alternative; a sample-mean difference alone does not establish that the population means differ.
- For a research question asking whether one group's mean is higher, the alternative uses a greater-than sign and the p-value comes from the right tail.
- The lecture illustrates the R calculation as 1 - pt(t, df) for a right-tailed test.
- The next study-method problem explicitly states equal population variances, triggering a pooled-variance standard error and pooled degrees of freedom.
- The study-method example gives Method A a sample size of 36 and mean score of 82, and assumes independent observations, normal populations, and equal variances.
- The pooled method combines the two sample variances to calculate the standard error; its degrees of freedom are n₁ + n₂ - 2, which is 83 in this example.
- For the alternative that Method A has a higher mean, the lecture reports t = 2.072 and a right-tailed p-value of 0.021.
- Because 0.021 is below α = 0.05, the example rejects the null and finds evidence that Method A's population mean is higher.
- R's t.test function can return the t statistic, degrees of freedom, and p-value from the two groups' data.
- The var.equal option controls the variance assumption: TRUE requests the pooled equal-variance test, while FALSE uses the unequal-variance approach.
- Adepoju demonstrates the workflow with University of Minnesota class-survey data on haircut spending by gender, emphasizing that the alternative must match the research question.
- He warns that the recent hypothesis-testing material is certain to appear on the final and reminds students of the 1:00 p.m. makeup exam in Ford Hall 300.
Transcript excerpt
0:00 over. Okay. Uh, good morning everyone. I want to welcome you to another statistical analysis class. Of course, uh today we're going to be working on two sample t test of comparing means. Uh but before I get started, um I'm
0:50 actually uh going to uh have a recap on what we did on Wednesday and what we want to do now and what is the connection between them and I'm going to use vacine example and not Not only that, I'm also going to take example today from legacy system. So I need you to pay attention. Is everybody ready? Okay. Now I'm going to have a recap on what we did
1:38 on Wednesday. In fact, it started from Monday. Let me first start. Let me start all the way from Monday. Now um on Monday we did what I called uh you know hypothesis testing on the difference you know uh between two we have um uh two means we have two groups but um is the same group. If you take a look at the vaccine maybe we have in the vaccine group we try to measure the antibodies of participant in the vaccine group before they were given vaccine
2:26 and after receiving vaccine we we have another measurement of the antibodies because uh clinically speaking a pharmaceutical company may want to investigate whether vaccine increases antibodies. Okay, that is why we actually uh want to see before the participant receive vaccine we know what is what do they have in terms of antibodies and after receiving the vaccine what do they have because we're using the same participants in two different occasion then what we did on Monday is relevant what we did on Monday is about that we
3:14 can construct confidence interval about the difference between before
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.