Skip to content

Instantly share code, notes, and snippets.

@deepak-karkala
Created December 29, 2020 06:43
Show Gist options
  • Save deepak-karkala/7b5d487c84dd2aec82329fa700d13098 to your computer and use it in GitHub Desktop.
Save deepak-karkala/7b5d487c84dd2aec82329fa700d13098 to your computer and use it in GitHub Desktop.
Z-test for A/B testing
# A/B testing: Z-test for Booking time (Normal Distribution)
from scipy.stats import norm
mu_A, std_A, n_A = 300, 105, 10000
mu_B, std_B, n_B = 296, 120, 10000
Z = (mu_A - mu_B)/np.sqrt(std_B**2/n_B + std_A**2/n_A)
pvalue = norm.sf(Z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment