metafor package, change the tol

metafor
#1

Hello there.
I have a problem with my rma.uni code in the metafor-package. Everytime I want to run my model, there is a error: "Ratio of largest to smallest sampling variance extremely large. Cannot obtain stable results". I know that I have to change the tol, because my variances differ to much, but I have no idea, how I can implement it.

Does anyone know, how to do it? That would be awesome.

Thank you :slight_smile:

0 Likes

#2

Hi martnbauer, welcome!

We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

0 Likes

#3

ok allright. Thanks for the answer. Here is an example of my problem:

0 Likes

#4

That is not a reproducible example, it's a screen shot and it's not a good practice in this forum

0 Likes

#5

yi<-c(1000,2000)
vi <-c(0.0000001, 1000000000)

res<-rma.uni(yi, vi)

Error in rma.uni(yi, vi) : Ratio of largest to smallest sampling variance extremely large. Cannot obtain stable results.

Is that better?

0 Likes

#6

Not really, because you are not including the library call and properly formatting your code, this would be a correct reprex of your issue.

library(metafor)

yi <- c(1000, 2000)
vi <- c(0.0000001, 1000000000)

res<-rma.uni(yi, vi)
#> Error in rma.uni(yi, vi): Ratio of largest to smallest sampling variance extremely large. Cannot obtain stable results.

Created on 2019-02-06 by the reprex package (v0.2.1)

0 Likes

#7

The package author replied about this error message here:

If you are trying to estimate an 'unstructured' var-cov matrix for 8 or 9 variables, then you are looking at 36 or 45 parameters. That is not a trivial optimization problem and could take a long time.

Depending on the model you are fitting, the V matrix itself does not have to be PD, as long as the marginal var-cov matrix is. But you are more likely to run into problems if V is not PD.

With respect to that error: In the 'devel' version, I did turn that error into a warning a while ago, so it will run, but the warning should be taken serious -- the results might not be trustworthy.

https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2018-April/000742.html


If you want to install that development version, there are instructions here

0 Likes

closed #8

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

0 Likes