-
Notifications
You must be signed in to change notification settings - Fork 10
Neyman's test of goodness of fit
Maurice HT Ling edited this page Aug 14, 2021
·
1 revision
Purpose: To test whether 2 distributions are equal.
Null hypothesis: Observed distribution = Expected distribution
Alternate hypothesis: Observed distribution ≠ Expected distribution
Code:
>>> from scipy import stats
>>> observed = [16, 18, 16, 14, 12, 12]
>>> expected = [16, 16, 16, 16, 16, 8]
>>> result = stats.power_divergence(observed, expected, lambda_="neyman")
>>> print("statistic = %.2f" % result.statistic)
statistic = 3.17
>>> print("p-value = %.2f" % result.pvalue)
p-value = 0.67
Reference:
- Neyman J. 1949. Contributions to the theory of the X2 test. Proceedings of the Berkeley Symposium on Mathematical Statistics and Probability, 239–273.
Copyright (c) 2008-2024, Maurice HT Ling
Refereed Publications and Technical Reports
Abstracts and Other Un-Refereed Works
Autobiographic Verses (Poems that I wrote) and My Sayings