Created
October 2, 2019 09:02
-
-
Save lylayang/6abd6e4fac9b5097772aa75b0d79acaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats as stats | |
from scipy.stats import chi2 | |
ob_table = np.array([[4514, 486], [4473, 527]]) | |
result = stats.chi2_contingency(ob_table, correction = False) # correction = False due to df=1 | |
chisq, pvalue = result[:2] | |
print('chisq = {}, pvalue = {}'.format(chisq, pvalue)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment