Skip to content

Instantly share code, notes, and snippets.

@deepak-karkala
Created December 29, 2020 06:46
Show Gist options
  • Save deepak-karkala/8a10b7df9efe3e24ee306bc3b1813ec6 to your computer and use it in GitHub Desktop.
Save deepak-karkala/8a10b7df9efe3e24ee306bc3b1813ec6 to your computer and use it in GitHub Desktop.
# A/B Testing: Conversion Rate: Distance between chi-squared distributions
# A/B Testing: Conversion Rate: Distance between chi-squared distributions
from scipy.stats import chi2
T = np.array([165, 165, 9835, 9835])
O = np.array([150, 180, 9850, 9800])
D = np.sum(np.square(T-O)/T)
pvalue = chi2.sf(D, df=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment