Enough People
An experiment will compare two groups of equal size with a two-sided t-test at significance level alpha. The true difference between the groups is effect standard deviations. Return the smallest whole number of people per group that gives the test at least power chance of detecting the difference.
Example 1
effect 0.5
alpha 0.05
power 0.8
returns 64
A medium effect of half a standard deviation needs 64 people in each group for 80% power.
Constraints
0.2 <= effect <= 1.5alphais 0.01, 0.05 or 0.10.7 <= power <= 0.95
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More statsmodels problems
- Honest ErrorHard
- Next Three ValuesHard
- Slope Through TimeHard
- The Repeating PartHard
- Which Findings SurviveHard
- How Much Is ExplainedBeginner
- How Sure Is the SlopeBeginner
- Line Through ZeroBeginner