[R-sig-ME] Binomial GLMM - Error (invalid class “mer” object)
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Thu Dec 6 09:49:06 CET 2012
Hi Robert,
Try to clean up your code. Use the data argument instead of the $ notation. And use glmer instead of lmer for generalized models. Addingspacesmakesyourcodemuchmorereadable
glmm1 <- glmer(cbind(Probes, fail) ~ Treatment * Species + (1|Bee), data = p, family = binomial)
Which version of R and lme4 are you using? The output of sessionInfo() can be informative for the developers of lme4.
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces op r-project.org [mailto:r-sig-mixed-models-bounces op r-project.org] Namens Robert Schaeffer
Verzonden: woensdag 5 december 2012 22:16
Aan: r-sig-mixed-models op r-project.org
Onderwerp: [R-sig-ME] Binomial GLMM - Error (invalid class “mer” object)
Hi All,
I'm relatively new to using GLMMs and am attempting to run an analysis, but have encountered an error that I am not sure how to handle.
Error invalidObject(.Object) : invalid class “mer” object: Slot Zt must by dims['q'] by dims['n']*dims['s']
I am trying to examine the effect of a treatment on the proportion of flowers probed per foraging bout in an inflorescence. There are two different pollinator species and each pollinator individual varied in the number of bouts performed. The data are structured as follows....
Bee Plant Flowers Species Treatment Probes fail
1 1 1 14 Bombus appositus Nectar 4 10
2 1 2 15 Bombus appositus Control 2 13
4 1 4 12 Bombus appositus Control 7 5
6 1 6 15 Bombus appositus Nectar 2 13
7 1 7 10 Bombus appositus Control 4 6
12 1 12 15 Bombus appositus Control 11 4
13 2 1 14 Bombus flavifrons Nectar 14 0
14 2 2 15 Bombus flavifrons Control 8 7
15 2 3 15 Bombus flavifrons Nectar 7 8
16 2 4 12 Bombus flavifrons Control 4 8
17 2 5 16 Bombus flavifrons Nectar 4 12
18 2 6 13 Bombus flavifrons Control 5 8
19 2 8 14 Bombus flavifrons Nectar 1 13
20 2 8 14 Bombus flavifrons Nectar 5 9
21 2 9 15 Bombus flavifrons Nectar 7 8
......
465 36 7 10 Bombus flavifrons Control 1 9
The model structure is as follows:
glmm1<-lmer(cbind(p$Probes,p$fail)~p$Treatment*p$Species+(1|p$Bee), family=
"binomial")
I included Bee identity as a random term to account for pseudoreplication and differences amongst Bees in the number of bouts performed. At least, I think this is the correct way to do so. However, I get the error above and am not sure how to proceed. Any thoughts or suggestions would be greatly appreciated.
Cheers,
Robert Schaeffer
[[alternative HTML version deleted]]
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-mixed-models
mailing list