Probability measures uncertainty and can represent a degree of belief about an event based on available evidence. In hypothesis testing, it supports reasoning about expected differences between groups. section 3.1.3
Use probability to connect hypotheses with evidence and expected effect sizes:
- Frequentist testing uses samples to make inferences about a broader population, often framing hypotheses around group differences and their direction. section 3.1.3
- Bayesian reasoning quantifies a hypothesized difference using evidence from research, organizational data, or stakeholder knowledge. section 3.1.3
Simulating treatment and control groups
A Python simulation generates overlapping normal distributions for control and treatment groups, shifting the treatment distribution two standard deviations to illustrate a strong difference. section 3.1.3
import numpy as np #1 import matplotlib.pyplot as plt c = np.random.normal(0, 1, size=500) #2 t = np.random.normal(2, 1, size=500) plt.hist(c, alpha=0.5, bins=25, color="black") #3 plt.hist(t, alpha=0.5, bins=25, color="lightgray") plt.legend(["Control", "Treatment"])
Run the NumPy and Matplotlib example to generate and compare simulated treatment and control histograms. section 3.1.3















