[R-sig-ME] Including a correlation matrix with the metafor package

Viechtbauer Wolfgang (STAT) wolfgang.viechtbauer at maastrichtuniversity.nl
Fri May 8 10:12:32 CEST 2015


This is indeed peculiar.

I don't quite remember if I had fixed some issue related to this in the most recent version of metafor. I just happened to submit version 1.9-6 to CRAN yesterday; you could also just download the dev version as described here:

http://www.metafor-project.org/doku.php/installation#development_version

Just in case, maybe try updating and check if the error still occurs.

Otherwise, it's going to be difficult to diagnose this further without a reproducible example.

Best,
Wolfgang

> -----Original Message-----
> From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces at r-
> project.org] On Behalf Of Eike-Lena Neuschulz
> Sent: Thursday, May 07, 2015 16:21
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] Including a correlation matrix with the metafor
> package
> 
> Dear R mailing list,
> 
> I have a problem using the metafor package. I would like to include a
> spatial correlation matrix with the R argument. I get an error message
> about levels in the random effects that are not represented in the
> rows/columns of the distance matrix. However, when comparing column and
> row names of the matrix with the levels of the random effect, they seem
> to be identical. See the output below.
> 
> I very much appreciate any help. Thank you very much!
> Best,
> Eike Lena Neuschulz
> 
> > SMDpot = rma.mv(yi, vi, random =  ~ 1 |studyChr,
> +                 mods = ~ process  -1   ,
> +                 R = list(studyChr = distMatModel),
> +                 data = SMD_big, method = "REML",
> +                 Rscale=FALSE)
> 
> Error in rma.mv(yi, vi, random = ~1 | studyChr, mods = ~process - 1, R =
> list(studyChr = distMatModel),  :
>   There are levels in 'studyChr' for which there are no rows/columns in
> the corresponding 'R' matrix.
> >
> >
> > identical(row.names(distMatModel),levels(SMD_big$studyChr))
> [1] TRUE
> > identical(colnames(distMatModel),levels(SMD_big$studyChr))
> [1] TRUE



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