The T-Test › Choosing the Right T-Test: Decision Framework

Michael BrenndoerferJanuary 3, 20263 min read
Machine Learning from ScratchAll chapters
Part 2 of 9Hypothesis Testing
Chapter 15The T-Test › Choosing the Right T-Test: Decision Framework
Reading section 8 of 11 · Choosing the Right T-Test: Decision Framework · 3 minSection 8 of 11 · 3 min

Book contents

Section 8 of 11 · 3 min read

The T-Test › Choosing the Right T-Test: Decision FrameworkOne section · Sections in this chapter8 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Selecting the appropriate t-test depends on your research design and data characteristics:

Out[17]:
Visualization
Flowchart showing decision process for t-test selection.
Decision tree for selecting the appropriate t-test. Start with the research design, then consider assumptions to choose between test variants. When in doubt about equal variances, Welch's t-test is the safer default.

Quick Reference:

ScenarioTestscipy.stats function
One sample vs. hypothesized valueOne-sample t-testttest_1samp(data, mu_0)
Two independent groups (default)Welch's t-testttest_ind(a, b, equal_var=False)
Two independent groups (equal variance confirmed)Pooled t-testttest_ind(a, b, equal_var=True)
Matched pairs / before-afterPaired t-testttest_rel(after, before)