MixedLM bug #1993

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

Projects

None yet

1 participant

@jseabold
Member

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
Member
@kshedden kshedden added a commit to kshedden/statsmodels that referenced this issue Sep 24, 2014
@kshedden kshedden Fix issue #1993 2064053
@josef-pkt josef-pkt closed this in #1995 Sep 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment