Skip to content

statsmodels.stats.proportion.py def proportions_ztest() line 577 version 0.6.1 #2969

Closed

Description

@erblast

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

  1. josef-pkt commented on May 25, 2016

    @josef-pkt
    Member

    It looks like there is a default value=0 missing, i.e.

    if value is None:
        value = 0
    

    looks like currently value is a required argument, current unit tests use value=0 for two sample case

    @erblast Thanks for reporting

  2. josef-pkt commented on May 30, 2016

    @josef-pkt
    Member

    see also #2734 and #2779

  3. added this to the 0.8 milestone on May 30, 2016
  4. added a commit that references this issue on Jun 21, 2016
    507fd0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions