Foundations of Inference in Python
Paul Savala
Assistant Professor of Mathematics
Example:

from scipy import stats import numpy as npci = stats.norm.interval(loc=80000, # Meanscale=10000/np.sqrt(100), # Standard erroralpha=0.95) # Confidence levelprint(ci)
(78040.04, 81959.96)
Valid inference requires a normal sampling distribution
population = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] sample_means = []for i in range(1000):sample_5 = np.random.choice(population, size=5)sample_means.append(sample_5.mean())
plt.hist(sample_means)


(and what it doesn't tell us)
Foundations of Inference in Python