Skip to content

Instantly share code, notes, and snippets.

@ritshpatidar
Created October 21, 2019 12:26
Show Gist options
  • Save ritshpatidar/9df7fc072676e9062749fd995a78fde0 to your computer and use it in GitHub Desktop.
Save ritshpatidar/9df7fc072676e9062749fd995a78fde0 to your computer and use it in GitHub Desktop.
#Fiding Chi-Square using Scipy
from scipy.stats import chi2_contingency
from scipy.stats import chi2
stat, _, dof, expected_table = chi2_contingency(con_table)
alpha = 0.05
#finding critical stat in Chi-Square table
critical_stat = chi2.ppf(1-alpha, dof) #it takes probability, instead of alpha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment