Skip to content

Instantly share code, notes, and snippets.

@panicpotatoe
Created March 12, 2019 03:05
Show Gist options
  • Select an option

  • Save panicpotatoe/9d46cb1d33aae86ff7b8b8955f70a32f to your computer and use it in GitHub Desktop.

Select an option

Save panicpotatoe/9d46cb1d33aae86ff7b8b8955f70a32f to your computer and use it in GitHub Desktop.
"""
Find the critical value for confidence of 95% and degree of freedom (df) of 8
Why df = 8?
Degree of freedom formula:
df = (total rows - 1) x (total columns - 1)
= (5 - 1) x (3 - 1)
= 4 x 2
= 8
"""
crit = stats.chi2.ppf(q=0.95, df=8)
print(crit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment