![]() |
| See Video ⮞ ☝ |
When to use a two-sample t-test
A two-sample t-test compares the population means of a quantitative outcome in two independent groups. In R, t.test() uses Welch’s method by default, which does not assume equal population variances. Use a pooled-variance test only when equal variances are justified by the design and analysis plan.
The observations must be independent within and between groups. The outcome should be quantitative, and for small samples the distributions within groups should be reasonably well behaved, without influential outliers. With larger samples, inspect the data and consider whether the sampling design supports the approximation.
Example: maize cob length
The video example compares cob length from six sampled plants in each of two fields. Define the groups, units, and sampling procedure clearly. If the fields differ in management or location, a mean difference cannot be attributed to field treatment alone; the comparison is observational and may be confounded.
For a two-sided test, the hypotheses are:
- Null: the population mean difference is zero,
H₀: μ₁ − μ₂ = 0. - Alternative: the population mean difference is nonzero,
H₁: μ₁ − μ₂ ≠ 0.
Choose the two-sided or directional alternative before examining the results. A one-sided test is appropriate only when the direction was specified in advance and an effect in the opposite direction would not support the research claim.
Interpreting the test
At a prespecified significance level such as 0.05, interpret the p-value together with the estimated difference and its confidence interval. Report the group means, sample sizes, estimated mean difference, interval, test statistic, degrees of freedom, and p-value. Statistical significance does not by itself show that the difference is practically important or caused by the grouping factor.

Comments
Post a Comment