Skip to content

Instantly share code, notes, and snippets.

@lylayang
Created October 2, 2019 08:44
Show Gist options
  • Save lylayang/5ef00c9b2e1b0e83d23453f398751123 to your computer and use it in GitHub Desktop.
Save lylayang/5ef00c9b2e1b0e83d23453f398751123 to your computer and use it in GitHub Desktop.
import statsmodels.stats.proportion as proportion
import numpy as np
converted = np.array([486, 527])
clicks = np.array([5000, 5000])
chisq, pvalue, table = proportion.proportions_chisquare(converted, clicks)
print('chisq =%.3f, pvalue = %.3f'%(chisq, pvalue))
print("Contingency Table:")
print(table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment