Last active
October 2, 2019 10:00
-
-
Save lylayang/c7fb38e6dc3bc527c95756a58901c165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import statsmodels.stats.api as sms | |
effect_size = 0.1 | |
alpha = 0.05 # significance level | |
power = 0.8 | |
sample_size = sms.TTestIndPower().solve_power(effect_size = effect_size, power = power, alpha = alpha) | |
print('Required sample size ~ {0:.1f}'.format(sample_size) + ' per group') | |
#Output: | |
#Required sample size ~ 1570.7 per group |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment