import numpy as np from statsmodels.stats.proportion import proportions_ztest count = np.array([45]) nobs = np.array([100]) val = 0.35 z, p = proportions_ztest(count=count, nobs=nobs, value=val) print(z) print(p)
import numpy as np from statsmodels.stats.proportion import proportions_ztest count = np.array([100, 170]) nobs = np.array([300, 400]) z, p = proportions_ztest(count=count, nobs=nobs, value=0) print(z) print(p)