Summary and Practical Guide to Hypothesis Testing › The Complete Hypothesis Testing Workflow
Michael BrenndoerferJanuary 10, 20264 min read
Machine Learning from ScratchAll chapters Part 2 of 9Hypothesis Testing
Summary and Practical Guide to Hypothesis Testing › The Complete Hypothesis Testing WorkflowOne section · Sections in this chapter2 / 12 ↓
Sections in this chapter12
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
Before diving into details, here's the complete workflow for conducting a hypothesis test. Each step is critical: skipping any one can invalidate your conclusions.
Out[3]:
Visualization
Step-by-Step Guide
Step 1: Formulate Hypotheses
- Define (null hypothesis): The default assumption, typically "no effect" or "no difference"
- Define (alternative hypothesis): What you're trying to demonstrate
- Choose one-tailed or two-tailed based on your research question
- Do this BEFORE seeing the data
Step 2: Choose Significance Level (α)
- Standard: α = 0.05 (5% false positive rate)
- Stringent: α = 0.01 for high-stakes decisions
- Lenient: α = 0.10 for exploratory research
- Consider the consequences of Type I vs Type II errors
Step 3: Determine Sample Size
- Use power analysis to calculate required n
- Specify: α, power (typically 0.80), minimum effect size of interest
- Balance statistical needs against practical constraints
Step 4: Collect Data
- Use appropriate randomization and sampling methods
- Ensure independence of observations
- Avoid peeking at results during collection
Step 5: Check Assumptions
- Normality: Shapiro-Wilk test, Q-Q plots
- Equal variances: Levene's test
- Independence: Study design consideration
- Choose alternatives that tolerate assumption violations
Step 6: Select and Compute Test
- Use the decision tree in the next section
- Calculate test statistic and p-value
- Compute confidence interval
Step 7: Make Decision
- If p < α: Reject H₀, conclude evidence for H₁
- If p ≥ α: Fail to reject H₀, insufficient evidence
- Remember: "fail to reject" ≠ "accept H₀"
Step 8: Report Results
- Effect size (Cohen's d, η², r)
- Confidence interval
- Exact p-value
- Test statistic and degrees of freedom
- Assumption check results