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
statsmodels.stats.proportion.py def proportions_ztest() line 577 version 0.6.1 #2969
statsmodels.stats.proportion.proportions_ztest() version 0.6.1
Issues:
i) In the present form line 577 of statsmodels.stats.proportion.py does not comply with what is stated in the docstring for the case of the two sample z-test.
In the case of a two-sample test, the
null hypothesis is that prop[0] - prop[1] = value, where prop is the
proportion in the two samples
ii) Function produces errors with the default parameter value=None in the one and two sample version
iii) docstring for nobs parameter should say --> nobs: integer or array_like,
Possible Solution:
line 577 should be changed from
diff = prop[0] - prop[1] - value
to:
diff = prop[0] - prop[1]
this makes the function work for me with the following parameters: count = np.array([5,12]), nobs=np.array([83,99]) and value = None
Activity
josef-pkt commentedon May 25, 2016
It looks like there is a default
value=0missing, i.e.looks like currently
valueis a required argument, current unit tests usevalue=0for two sample case@erblast Thanks for reporting
josef-pkt commentedon May 30, 2016
see also #2734 and #2779
BUG: Fix incorrect default value handling in proportions_ztest