Skip to content

BUG: GEE subclasses NominalGEE don't work with pandas exog  #1931

Closed

Description

@josef-pkt

using pandas.DataFrame for endog and exog raises and exception in __init__ setup_nominal

======================================================================
ERROR: statsmodels.genmod.tests.test_gee.TestGEEMultinomialCovType.test_wrapper
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\programs\python27\lib\site-packages\nose-1.0.0-py2.7.egg\nose\case.py", line 187, in runTest
    self.test(*self.arg)
  File "E:\Josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\genmod\tests\test_gee.py", line 968, in test_wrapper
    @classmethod
  File "E:\Josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\genmod\generalized_estimating_equations.py", line 1692, in __init__
    exog, groups, time, offset)
  File "E:\Josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\genmod\generalized_estimating_equations.py", line 1742, in setup_nominal
    exog_out[jrow, :] = np.kron(u, exog_row)
ValueError: operands could not be broadcast together with shapes (4) (2)

I'm in the middle of adding the wrappers and this is a test failure, but it looks unrelated to the wrappers.
I haven't tested outside of my branch. PR #1916

Both, OrdinalGEE and NominalGEE, call setup_xxx before doing the super call. The data is preprocessed, but there is no asarray in there.

Correction
OrdinalGEE has a set of `asarray in there and works without problems with pandas DataFrames

I don't know whether from_formula works, no test case, and I haven't tried an example yet.

Activity

  1. josef-pkt commented on Aug 22, 2014

    @josef-pkt
    MemberAuthor

    Ok, copying the asarray from OrdinalGEE to NominalGEE fixes it.

  2. changed the title [-]BUG: GEE subclasses OrdinalGEE, NominalGEE don't work with pandas exog [/-] [+]BUG: GEE subclasses NominalGEE don't work with pandas exog [/+] on Aug 22, 2014
  3. added a commit that references this issue on Aug 22, 2014
    3062a80
  4. added a commit that references this issue on Aug 29, 2014
    83bb8c1
  5. added a commit that references this issue on Oct 23, 2014
    f48717d
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