Skip to content

[R-meta] GLMM issue with metaprop / meta package

6 messages · Guido Schwarzer, Richter Dirk, Wolfgang Viechtbauer

#
Dear Dirk,

Recently, somebody asked the same question on GitHub (https://github.com/guido-s/meta/issues/57).

I changed the development version of meta such that the results of the common effect model are used as a fallback in metaprop() if the GLMM estimation fails (I am not sure any more whether this is a sensible approach. Any comments from the list are welcome on this.).

As Michael hinted, you can use verbose = TRUE to get more information on the estimation process. However, this is an argument of rma.glmm() from R package metafor called internally in metaprop() from R package meta.

The metaprop() call must look like the following:

metaprop(..., control = list(verbose = TRUE))

Best,
Guido
#
Thanks, Guido and Michael. It's obviously an issue related to the Matrix package. The verbose argument mentioned this error but did not produce any results.
Do I understand it correctly that the Inverse method is sufficient for a random effects model?
Thanks again,
Dirk

-----Urspr?ngliche Nachricht-----
Von: Dr. Guido Schwarzer <guido.schwarzer at uniklinik-freiburg.de> 
Gesendet: Freitag, 5. April 2024 17:48
An: R Special Interest Group for Meta-Analysis <r-sig-meta-analysis at r-project.org>
Cc: Richter Dirk <dirk.richter at bfh.ch>
Betreff: Re: [R-meta] GLMM issue with metaprop / meta package

Dear Dirk,

Recently, somebody asked the same question on GitHub (https://github.com/guido-s/meta/issues/57).

I changed the development version of meta such that the results of the common effect model are used as a fallback in metaprop() if the GLMM estimation fails (I am not sure any more whether this is a sensible approach. Any comments from the list are welcome on this.).

As Michael hinted, you can use verbose = TRUE to get more information on the estimation process. However, this is an argument of rma.glmm() from R package metafor called internally in metaprop() from R package meta.

The metaprop() call must look like the following:

metaprop(..., control = list(verbose = TRUE))

Best,
Guido
3 days later
#
Hi Dirk,

If you could share the data, I can take a look at why rma.glmm() struggles to fit the model.

Whether one can just use the inverse-variance method is impossible to say without further details.

Best,
Wolfgang
#
Dirk has kindly shared the data with me off-list. With:

m1 <- metaprop(event, n, studlab=paste(author, pubyear), data=metadata,
               method = "GLMM", control = list(verbose = TRUE))

Dirk is getting the error:

# Error in initializePtr() :
#  function 'chm_factor_ldetL2' not provided by package 'Matrix'

while the code runs just fine for me. Some searching leads to:

https://github.com/lme4/lme4/issues/763
https://stackoverflow.com/q/77481539/2615367

which indicates that this issue has nothing to do with meta/metafor or this specific dataset but that the error arises due an update in the Matrix package.

I would start with reinstalling the Matrix package and then lme4:

install.packages("Matrix")
install.packages("lme4")

To be on the safe side, restart R before and after doing so. One could also try installing lme4 from source as described in the links above, but this requires having everything set up for doing so on your computer and this shouldn't really be necessary. On a Windows machine that I just tried, everything works fine with metaprop() when everything is up-to-date.

Best,
Wolfgang
#
Wonderful, thanks, Wolfgang.
Re-installing Matrix and lme4 solved the problem.
Best wishes,
Dirk


-----Urspr?ngliche Nachricht-----
Von: Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer at maastrichtuniversity.nl> 
Gesendet: Mittwoch, 10. April 2024 10:46
An: R Special Interest Group for Meta-Analysis <r-sig-meta-analysis at r-project.org>
Cc: Richter Dirk <dirk.richter at bfh.ch>
Betreff: RE: [R-meta] GLMM issue with metaprop / meta package

Dirk has kindly shared the data with me off-list. With:

m1 <- metaprop(event, n, studlab=paste(author, pubyear), data=metadata,
               method = "GLMM", control = list(verbose = TRUE))

Dirk is getting the error:

# Error in initializePtr() :
#  function 'chm_factor_ldetL2' not provided by package 'Matrix'

while the code runs just fine for me. Some searching leads to:

https://github.com/lme4/lme4/issues/763
https://stackoverflow.com/q/77481539/2615367

which indicates that this issue has nothing to do with meta/metafor or this specific dataset but that the error arises due an update in the Matrix package.

I would start with reinstalling the Matrix package and then lme4:

install.packages("Matrix")
install.packages("lme4")

To be on the safe side, restart R before and after doing so. One could also try installing lme4 from source as described in the links above, but this requires having everything set up for doing so on your computer and this shouldn't really be necessary. On a Windows machine that I just tried, everything works fine with metaprop() when everything is up-to-date.

Best,
Wolfgang
#
Great, happy to hear this. This kind of issue with the Matrix package can arise again in the future if there are changes that break binary compatibility. See, for example, the announcement on the R-package-devel mailing list from February:

https://stat.ethz.ch/pipermail/r-package-devel/2024q1/010463.html

This affects packages that make use of Matrix, notably lme4 and glmmTMB (via TMB), which are also used within metafor. It can then take a bit of time for everything to be 'aligned' again when pulling binary versions of packages from CRAN.

Best,
Wolfgang