I have two samples of binary data. I'm performing a one tailed hypothesis test if one of the samples success rate is significantly higher than the other's. I'm using statsmodels proportions_ztest. I was wondering how I could calculate the power for this type of test? (two binary samples.) does anyone know if there's a built in funciton in statsmodels I could use, or else suggest the calculation or code?
code:
from statsmodels.stats.proportion import proportions_ztest
number_of_successes = [5481, 195]
total_sample_sizes = [81530, 135779]
# Calculate z-test statistic and p-value
test_stat, p_value = proportions_ztest(number_of_successes, total_sample_sizes, alternative='larger')
print(str(test_stat))
print(str(p_value))
93.10329278601503
0.0