180. Chi-Square Goodness of Fit
180.0.1. Goodness of Fit Test
Compares an observed categorical distribution to a theoretical categorical distribution.
- : observed frequency in category
- : expected frequency in category
chi2_got.py
from scipy import stats
f_obs = np.array([43, 52, 54, 40])
f_exp = np.array([47, 47, 47, 47])
stats.chisquare(f_obs=f_obs, f_exp=f_exp)