Skip to content
Prev 18398 / 20628 Next

Error in initializePtr() : updateMu: Size mismatch

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,
Cesko

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

Hallo,

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?

Thanks


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