Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in runGLMM using the metaprop function #57

Closed
1 of 3 tasks
bleclere opened this issue Mar 19, 2024 · 7 comments
Closed
1 of 3 tasks

Error in runGLMM using the metaprop function #57

bleclere opened this issue Mar 19, 2024 · 7 comments

Comments

@bleclere
Copy link

Note: for support questions on R package meta, please use the R-sig-meta-analysis mailing list. This repository's issues are reserved for feature requests and bug reports.

Classification of issue

Please indicate whether you want to submit a

  • feature request
  • bug report
  • support request (please do not submit support requests here, but use R-sig-meta-analysis)

Summary

Hi,
I’m trying to run a meta-analysis on single proportions, but I encounter an error with the metaprop function.

Additional information

Code that produces the bug:

metaprop(4:1, 10 * 1:4) # metaprop documentation example

Output:

Error in runGLMM(list.prop, method.tau = method.tau, method.random.ci = method.random.ci,  : 
  Error in (function (ai, bi, ci, di, n1i, n2i, x1i, x2i, t1i, t2i, xi,  : 
  Cannot fit ML model (set 'verbose=TRUE' to obtain further details).

Environment

  • operating system: MacOs Ventura 13.6.4
  • R version 4.3.3
  • Version of R package meta : 7.0.0
@badgettrg
Copy link

Having similar problem with metaprop on both current meta and last version. No missing data. This same data and function have run in the past for me. Windows R version 4.3.3, metafor 4.4:

meta1 <- metaprop(Outcome, Denom, studlab=Study, method="GLMM", data = data.temp)

Error in runGLMM(list.prop, method.tau = method.tau, method.random.ci = method.random.ci, : Error in (function (ai, bi, ci, di, n1i, n2i, x1i, x2i, t1i, t2i, xi, : Cannot fit ML model (set 'verbose=TRUE' to obtain further details).

Someone else with similar problem at https://stackoverflow.com/questions/78016615/trouble-fitting-glmm-model-in-r-error-in-runglmm-function

thanks

@bleclere bleclere changed the title Error reproducing metaprop documentation example Error in runGLMM using the metaprop function Mar 21, 2024
@bleclere
Copy link
Author

Thank you for your comment @badgettrg.
I have edited the the title for a more accurate description of the issue.

guido-s added a commit that referenced this issue Apr 2, 2024
@guido-s
Copy link
Owner

guido-s commented Apr 2, 2024

I cannot reproduce the error in metaprop(4:1, 10 * 1:4). However, I could create the error with the following command: metaprop(rep(1, 5), rep(100, 5)), i.e., in a meta-analysis without any between-study heterogeneity.

I changed the behaviour of runGLMM() such that results of the common effect model are used as a fallback if the random effects model does not converge.

BTW, the following command can be used to get more information on the estimation process and the error: metaprop(rep(1, 5), rep(100, 5), control = list(verbose = TRUE))

@guido-s guido-s closed this as completed Apr 2, 2024
@badgettrg
Copy link

badgettrg commented Apr 2, 2024 via email

@bleclere
Copy link
Author

bleclere commented Apr 4, 2024

Thanks a lot!
It fixed the problem that occurred with my data.

For info, I still get a warning with metaprop(4:1, 10 * 1:4), and verbose = TRUE for runGLMM indicates :

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

But it gives back a result.

Thanks again
Brice

@guido-s
Copy link
Owner

guido-s commented Apr 4, 2024

Good to hear.

I do not get that error (see below). I am running R under macOS (current R version with up-to-date R packages).

Best,
Guido

> meta::metaprop(4:1, 10 * 1:4, control = list(verbose = TRUE))
Iteration 0     tau^2 = 1.3207
Iteration 1     tau^2 = 0.7621
Iteration 2     tau^2 = 0.7226
Iteration 3     tau^2 = 0.7185
Iteration 4     tau^2 = 0.7180
Iteration 5     tau^2 = 0.7180
Iteration 6     tau^2 = 0.7180
Fisher scoring algorithm converged after 6 iterations.

Fitting FE model ...
Deviance = 11.51912 Iterations - 1
Deviance = 10.6096 Iterations - 2
Deviance = 10.59965 Iterations - 3
Deviance = 10.59965 Iterations - 4
Deviance = 10.59965 Iterations - 5
Fitting saturated model ...
Deviance = 0.004684332 Iterations - 1
Deviance = 3.567321e-06 Iterations - 2
Deviance = 2.879965e-12 Iterations - 3
Deviance = -4.440892e-15 Iterations - 4

Fitting FE model ...
Deviance = 11.51912 Iterations - 1
Deviance = 10.6096 Iterations - 2
Deviance = 10.59965 Iterations - 3
Deviance = 10.59965 Iterations - 4
Deviance = 10.59965 Iterations - 5
Fitting saturated model ...
Deviance = 0.004684332 Iterations - 1
Deviance = 3.567321e-06 Iterations - 2
Deviance = 2.879965e-12 Iterations - 3
Deviance = -4.440892e-15 Iterations - 4
Fitting ML model ...
start par. =  1 fn =  18.2879
At return
eval:  15 fn:      18.271925 par: 0.928227
(NM) 20: f = 8.06915 at 0.948227 -2.15163
(NM) 40: f = 8.06907 at 0.952002 -2.14855
(NM) 60: f = 8.06907 at 0.952207 -2.14864
...

@bleclere
Copy link
Author

bleclere commented Apr 4, 2024

After a little digging, it seems to be a problem with a specific version of the Matrix package. It all works fine now, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants