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

Pamela Ochungo p@mochungo @end|ng |rom gm@||@com
Fri May 1 22:15:15 CEST 2020


Hi Cesko,

Thanks for your reply! I have tried the second option, function gam() from
mgcv. However I get an unexpected result as below:

Family: Multivariate normal
Link function:

Formula:
transpopbees ~ Varroa + s(Site, bs = "re") + s(Colony,
    bs = "re")
transbrood ~ Varroa + s(Site, bs = "re") + s(Colony, bs = "re")
transhoney ~ Varroa + s(Site, bs = "re") + s(Colony, bs = "re")
transpollen ~ Varroa + s(Site, bs = "re") + s(Colony, bs = "re")
transeggs ~ Varroa + s(Site, bs = "re") + s(Colony, bs = "re")

Estimated degrees of freedom:
0.0001 0.7631 0.0000 0.0003 1.7061 0.0003 1.7192
0.0002 0.0000 0.0003  total = 29.19

REML score: 547.659

How do I interpret this? I was rather hoping to get a result showing model
coefficients and p-values for each dependent variable.


Question: Is it acceptable to carry out LMM (lmer) for each of the 5
dependent variables separately against Varroa?

Cheers

Pamela

On Fri, May 1, 2020 at 10:25 PM Voeten, C.C. <c.c.voeten using hum.leidenuniv.nl>
wrote:

> 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 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
>
> 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
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



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