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.
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.
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.
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.