notes

Hypothesis Testing

Assumptions

Which test to use

If you know the population standard deviation and you have a sufficient sample size, you’ll probably want a z-test, otherwise break out the t-test.

Power and sample size

Power analysis involves four moving parts:

sample_sizes = np.array(range(5, 100))
effect_sizes = np.array([0.2, 0.5, 0.8])

# Create results object for t-test analysis
from statsmodels.stats.power import TTestIndPower
results = TTestIndPower()

# Plot the power analysis
results.plot_power(dep_var='nobs', nobs=sample_sizes, effect_size=effect_sizes)
plt.show()

power relationship

Not only does an increase in power result in a larger sample size, but this increase grows exponentially as the minimum effect size is increased.

Multiple testing