[R-sig-ME] possible lmer compatibility bug?
Brandon Invergo
brandon at brandoninvergo.com
Wed Aug 20 20:10:04 CEST 2008
Well, I'm not sure how to give you a reproducible example. What I can
say is that it happens every time I use lmer() in R 2.7.1, for any model
formula. Using the same data file, lmer() successfully completes in
2.7.0 but it returns the error in 2.7.1. For what it's worth, here's an
example (in the data, dev.time is an integer, sex and temp are factors
(2 levels and 5 levels, resp.), and sleeve.in.temp is a random variable):
2.7.0:
> dev.modelc <- lmer(dev.time ~ sex*temp + (1|sleeve.in.temp),
data=data.clean, family=Gamma(link="log"))
> summary(dev.modelc)
Generalized linear mixed model fit using Laplace
Formula: dev.time ~ sex * temp + (1 | sleeve.in.temp)
Data: data.clean
Family: Gamma(log link)
AIC BIC logLik deviance
29.28 87.32 -3.639 7.277
Random effects:
Groups Name Variance Std.Dev.
sleeve.in.temp (Intercept) 2.5683e-12 1.6026e-06
Residual 5.1366e-03 7.1670e-02
number of obs: 1446, groups: sleeve.in.temp, 54
Fixed effects:
Estimate Std. Error t value
(Intercept) 3.659500 0.005993 610.6
sexm -0.088450 0.008956 -9.9
temp21 -0.207295 0.008132 -25.5
temp23 -0.433156 0.008363 -51.8
temp25 -0.612696 0.008491 -72.2
temp27 -0.755628 0.008297 -91.1
sexm:temp21 0.008189 0.012000 0.7
sexm:temp23 -0.003357 0.012243 -0.3
sexm:temp25 -0.014887 0.012321 -1.2
sexm:temp27 0.010674 0.012405 0.9
Correlation of Fixed Effects:
(Intr) sexm temp21 temp23 temp25 temp27 sxm:21 sxm:23 sxm:25
sexm -0.669
temp21 -0.737 0.493
temp23 -0.717 0.480 0.528
temp25 -0.706 0.472 0.520 0.506
temp27 -0.722 0.483 0.532 0.518 0.510
sexm:temp21 0.499 -0.746 -0.678 -0.358 -0.353 -0.361
sexm:temp23 0.490 -0.731 -0.361 -0.683 -0.346 -0.354 0.546
sexm:temp25 0.486 -0.727 -0.358 -0.349 -0.689 -0.351 0.542 0.532
sexm:temp27 0.483 -0.722 -0.356 -0.346 -0.341 -0.669 0.539 0.528 0.525
>sessionInfo()
R version 2.7.0 (2008-04-22)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] gplots_2.6.0 gdata_2.4.2 gtools_2.5.0 nlme_3.1-88
[5] lme4_0.99875-9 Matrix_0.999375-9 lattice_0.17-6
loaded via a namespace (and not attached):
[1] grid_2.7.0
and for 2.7.1:
> dev.modelc <- lmer(dev.time ~ sex*temp + (1|sleeve.in.temp),
data=data.clean, family=Gamma(link="log"))
> summary(dev.modelc)
Error in asMethod(object) : matrix is not symmetric [1,2]
> traceback()
15: .Call(dense_to_symmetric, from, "U", TRUE)
14: asMethod(object)
13: as(from, "symmetricMatrix")
12: .class1(object)
11: as(as(from, "symmetricMatrix"), "dMatrix")
10: .class1(object)
9: as(as(as(from, "symmetricMatrix"), "dMatrix"), "denseMatrix")
8: .class1(object)
7: as(as(as(as(from, "symmetricMatrix"), "dMatrix"), "denseMatrix"),
"dpoMatrix")
6: asMethod(object)
5: as(sigma(object)^2 * chol2inv(object at RX, size = object at dims["p"]),
"dpoMatrix")
4: vcov(object)
3: vcov(object)
2: summary(dev.modelc)
1: summary(dev.modelc)
> sessionInfo()
R version 2.7.1 (2008-06-23)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] gplots_2.6.0 gdata_2.4.2 gtools_2.5.0
nlme_3.1-89
[5] lme4_0.999375-25 Matrix_0.999375-11 lattice_0.17-8
loaded via a namespace (and not attached):
[1] grid_2.7.1
I'm sorry, I wasn't aware of the sessionInfo() or traceback() functions
as this was the first time I've ever encountered an error like this in
R. I'll be sure to be more courteous and include them next time...
Douglas Bates wrote:
> On Wed, Aug 20, 2008 at 12:02 PM, Brandon Invergo
> <brandon at brandoninvergo.com> wrote:
>
>> Dear all,
>>
>
>
>> I was just driving myself crazy trying to figure out this sudden error
>> message I was getting on lines of code that were working fine the other day.
>> Every time I tried to make a model with the lmer() function, it would return
>> the following error: "Error in asMethod(object) : matrix is not symmetric
>> [1,2]"
>>
>
>
>> I realized, though, that the only thing that had changed was the version of
>> R I was using, having just switched to version 2.7.1. Sure enough, when I
>> loaded up v2.7.0, the script worked fine and I could successfully call lmer.
>>
>
>
>> Is there something I'm possibly doing wrong that's preventing it from
>> working in 2.7.1? Or is this a known problem?
>>
>
> It appears that you have too high a regard for the readers of this
> list in that you expect them to have psychic powers :-)
>
> More seriously, if you read your message and think of how a person
> could possibly create a meaningful response based on the information
> that you have given us, I think you will see that we don't have nearly
> enough information to go on.
>
> A reproducible example rather than a description of "lines of code
> that were working fine" is what we will need before we can expect to
> provide a useful answer to you. Also, information like the output
> from
>
> sessionInfo()
>
> and perhaps
>
> traceback()
>
> after the error message so we know what was going on at the time the
> error occurred. Most importantly, we need to know what the call was
> that resulted in an error.
>
More information about the R-sig-mixed-models
mailing list