I have the code below that I'm using to try to calculate the statistical power of detecting an effect size as large as the one below, with the given sample size. I'm calculating power for a one sample ttest with the alternative hypothesis that the sample mean is larger. No matter what I change the alpha parameter to I seem to get a power of 1.0 which seems large and incorrect. Am I doing something wrong below? If so, can someone please point out what I need to change? If it is correct, can someone please explain why?
values:
mean of population:
abar=35.95678241834582
mean of sample:
bbar=42.434961073666734
standard deviation of population:
astd=36.668227035470316
observations in sample:
nb=13933
code:
from statsmodels.stats.power import TTestIndPower
power_analysis = TTestIndPower()
effct_size = (bbar-abar)/astd
power = power_analysis.solve_power(effect_size = effct_size,
nobs1=nb,
power=None,
alpha = 0.05,
alternative='larger')
power
output:
1.0