Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MixedLM bug #1993

Closed
jseabold opened this issue Sep 23, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@jseabold
Copy link
Member

commented Sep 23, 2014

Somewhere exog_re gets changed from an array to a list.

[25]: paste
import statsmodels.api as sm
import statsmodels.formula.api as smf
data = sm.datasets.get_rdataset("dietox", "geepack", cache=True).data

md = smf.mixedlm("Weight ~ Time", data, groups=data["Pig"])
mdf = md.fit()

print mdf.profile_re(0)
print mdf.profile_re(0)

## -- End pasted text --
[[   29.94144197 -2406.61496645]
 [   32.03455083 -2405.85095315]
 [   34.12665634 -2405.33098125]
 [   36.21794445 -2405.00312497]
 [   38.30855783 -2404.82800869]
 [   40.39860778 -2404.77533787]
 [   42.48818238 -2404.82150608]
 [   44.57735228 -2404.94790994]
 [   46.66617478 -2405.13974143]
 [   48.75469685 -2405.38510771]
 [   50.84295737 -2405.6743806 ]]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-25-cb0be708ca17> in <module>()
      7 
      8 print mdf.profile_re(0)
----> 9 print mdf.profile_re(0)

/home/skipper/statsmodels/statsmodels-skipper/statsmodels/regression/mixed_linear_model.py in profile_re(self, re_ix, num_low, dist_low, num_high, dist_high)
   1960         model = self.model
   1961         k_fe = model.exog.shape[1]
-> 1962         k_re = model.exog_re.shape[1]
   1963 
   1964         # Need to permute the columns of the random effects design

AttributeError: 'list' object has no attribute 'shape'

@jseabold jseabold added this to the 0.6 milestone Sep 23, 2014

@jseabold

This comment has been minimized.

Copy link
Member Author

commented Sep 23, 2014

kshedden added a commit to kshedden/statsmodels that referenced this issue Sep 24, 2014

josef-pkt added a commit that referenced this issue Sep 24, 2014

Merge pull request #1995 from kshedden/mixedlm_1993
BUG: MixedLM list instead of array closes #1993
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.