[R-sig-ME] Error in initializePtr() : updateMu: Size mismatch

Voeten, C.C. c@c@voeten @end|ng |rom hum@|e|denun|v@n|
Fri May 1 21:25:14 CEST 2020

Hi Pamela,

lmer/glmer do not support models with multiple dependent variables via the cbind() syntax. An alternative approach is to convert your data to long format and run the model in the following way:

value ~ 0+variable/Varroa + (0+variable|Site) + (0+variable|Colony)

with 'variable' the column containing "transpopbees", "transbrood", ..., and 'value' the column containing their values.
Alternatively, function gam() from package mgcv can fit your model. You would then use something like:

gam(list(transpopbees ~ Varroa + s(Site,bs='re') + s(Colony,bs='re'), transbrood ~ Varroa + s(Site,bs='re') + s(Colony,bs='re'), .....),family=mvn(5),data=pollencolony)

Hope this helps,

-----Original Message-----
From: R-sig-mixed-models <r-sig-mixed-models-bounces using r-project.org> On Behalf Of Pamela Ochungo
Sent: Friday, May 1, 2020 9:00 PM
To: r-sig-mixed-models using r-project.org
Subject: [R-sig-ME] Error in initializePtr() : updateMu: Size mismatch


I want to run a linear mixed model featuring 5 response variables and only one predictor variable. I also have two random effects in the model. I am using this code:

lm1 <- lmer(cbind(transpopbees, transbrood, transhoney, transpollen,
transeggs) ~ Varroa+(1|Site)+(1|Colony),data=pollencolony)

However I get this error message:

Error in initializePtr() : updateMu: Size mismatch

What does this mean and what am I doing wrong?


	[[alternative HTML version deleted]]

R-sig-mixed-models using r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

More information about the R-sig-mixed-models mailing list