You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chisquare and chisquare_power functions are missing in docs #7369
changed the title [-]chisquare and chisquare_power function missing in docs[/-][+]chisquare and chisquare_power functions are missing in docs[/+]on Mar 9, 2021
@josef-pkt thanks for the quick response. It would be great to have some note in the documentation of what package's method (statsmodels or scipy) developers should use. Currently, I'm trying to search over two packages. It would be helpful to have links from statsmodels to scipy and vice-versa, to have at least one source that provides a more complete reference for statistical inference.
I'm good to close this ticket because of the initial issue that has been solved by your answer.
It would be great to have some note in the documentation of what package's method (statsmodels or scipy) developers should use
That's a bit of a moving target because both packages are changing and it depends on the use case. So we add See Also (if we didn't forget doing it.), but no recommendation.
In general, if scipy.stats has what you need, then you can use it. scipy.stats has now many maintainers and contributors. In several cases scipy.stats had the simpler interface or return.
e.g. I often use simple t-test from scipy instead of statsmodels.
It used to be that statsmodels has more options when there is an overlap in functionality. But recent development in scipy.stats is also adding more option, and also adding some kind of results structure instead of just returning numbers.
So, that difference is decreasing.
statsmodels often has vectorized versions of hypothesis test or similar, as long as the arguments broadcast appropriately.
an example: scipy.stats got brunner_munzel test a year or two ago and it is just the hypothesis test, My recent version in statsmodels has confidence intervals, equivalence tests and similar additions to the basic test statistic and hypothesis test.
gof in the case of this issue is better maintained in scipy.stats, but we have additional effect size and power and sample size computation.
Notes
-----
The case with value greater than zero is similar to an equivalence test,
that the exact null hypothesis is replaced by an approximate hypothesis.
However, TOST "reverses" null and alternative hypothesis, while here the
alternative hypothesis is that the distance (divergence) is larger than a
threshold.
that is, chisquare has a value argument for minimum effect test, I called it nonequivalence in poisson rates.
I also did something similar/opposite in oneway with equivalence test based on a chisquare like distance statistic.
Related: I have worked more on binned or discrete chisquare test for model diagnostic.
Also related, tests for multinomial samples or proportions.
I don't have an overview right now, but there should be some common structure and overlap.
I need a SUMM issue to look at this.
Activity
[-]chisquare and chisquare_power function missing in docs[/-][+]chisquare and chisquare_power functions are missing in docs[/+]josef-pkt commentedon Mar 9, 2021
Thanks for reporting
chisquare is likely missing intentionally
I think there is no advantage in using it compared to scipy.stats.chisquare.
similarly, power_discrepancy has gotten a more maintained version, after some time when I wrote this.
chisquare_power might be a useful function for the docs, but the main access is through the
powerclass which also includes sample size computation. https://www.statsmodels.org/devel/generated/statsmodels.stats.power.GofChisquarePower.htmlThis part is AFAIR, because there are different versions of chisquare (based) tests and associated power computation.
I guess most of that module would need a proper review.
dbalabka commentedon Mar 10, 2021
@josef-pkt thanks for the quick response. It would be great to have some note in the documentation of what package's method (statsmodels or scipy) developers should use. Currently, I'm trying to search over two packages. It would be helpful to have links from statsmodels to scipy and vice-versa, to have at least one source that provides a more complete reference for statistical inference.
I'm good to close this ticket because of the initial issue that has been solved by your answer.
josef-pkt commentedon Mar 10, 2021
That's a bit of a moving target because both packages are changing and it depends on the use case. So we add
See Also(if we didn't forget doing it.), but no recommendation.In general, if scipy.stats has what you need, then you can use it. scipy.stats has now many maintainers and contributors. In several cases scipy.stats had the simpler interface or return.
e.g. I often use simple t-test from scipy instead of statsmodels.
It used to be that statsmodels has more options when there is an overlap in functionality. But recent development in scipy.stats is also adding more option, and also adding some kind of results structure instead of just returning numbers.
So, that difference is decreasing.
statsmodels often has vectorized versions of hypothesis test or similar, as long as the arguments broadcast appropriately.
an example: scipy.stats got brunner_munzel test a year or two ago and it is just the hypothesis test, My recent version in statsmodels has confidence intervals, equivalence tests and similar additions to the basic test statistic and hypothesis test.
gof in the case of this issue is better maintained in scipy.stats, but we have additional effect size and power and sample size computation.
josef-pkt commentedon Jun 29, 2022
I put this on my todo, to review list for 0.15
chisquare has
that is, chisquare has a value argument for minimum effect test, I called it
nonequivalencein poisson rates.I also did something similar/opposite in
onewaywith equivalence test based on a chisquare like distance statistic.Related: I have worked more on binned or discrete chisquare test for model diagnostic.
Also related, tests for multinomial samples or proportions.
I don't have an overview right now, but there should be some common structure and overlap.
I need a SUMM issue to look at this.