Skip to content

support for contingency table #879

Open

Description

@josef-pkt

see discussion in #878

mostly a wrapper around formulas, pandas crosstabs and statistical tests.

formula interface to pandas might not be so easy if patsy does different preprocessing, eg convert bool to dummy. For simple cases (2x2 or 2xk) it might be easier to just use numpy after patsy.

update Nov 2015
#2418 PR merged contingency table support

Activity

  1. josef-pkt commented on Jun 19, 2013

    @josef-pkt
    MemberAuthor

    I wouldn't go that way anymore

    http://pandas.pydata.org/pandas-docs/dev/reshaping.html#pivot-tables-and-cross-tabulations
    for a general solution.

    I'm coding only very specific cases in numpy for statsmodels, like 2-sample and k-sample comparisons, or specific kxk tables, for interrater cohens and fleiss kappa for example.

  2. josef-pkt commented on Jun 19, 2013

    @josef-pkt
    MemberAuthor

    I didn't read carefully enough

    my last comment referred to the numpy mailing list, not to pyvttbl
    we would still like to integrate parts of pyvttbl using pandas dataframes

  3. jankatins commented on Jun 20, 2013

    @jankatins
    Contributor

    So more or less like that:

    This would mean that pandas is a hard dependency on that method. I thought that statsmodels should work without pandas?

  4. josef-pkt commented on Jun 20, 2013

    @josef-pkt
    MemberAuthor

    We can use pandas as a hard dependency in a function. Whether we do is mainly a pragmatic decision. interaction plots are mostly pandas.

    However, I think I would also add a second entrance to the class that takes a contingency table directly. That will be convenient for many cases when users already have the contingency table.

    It also depends on how general a solution this should be, for simpler cases going through pandas might not be necessary.

    Also, we don't have any code yet that goes from formula to a pandas dataframe. Interaction_plot and similar functions take 2 factor levels directly as arrays. I don't have enough experience with this part to see what would be a good way to connect this, especially how much processing patsy will do when we use a formula. ( issue #878 ), If users already hand in a dataframe, then it might be easier just to get the terms from the parsed formula and use pandas directly - just guessing.

    Since you mentioned it again, I browsed pyvttbl again. I think the results look nice and it would be useful to get something similar, however in a more numpy/pandas/scipy/statsmodels style.

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions