[R] metafor package: study level variation

Jarrett Byrnes jarrett.byrnes at umb.edu
Fri Sep 7 16:02:22 CEST 2012


Hello.  A quick question about incorporating variation due to study in the metafor package.  I'm working with a particular data set for meta-analysis where some studies have multiple measurements.  Others do not.  So, let's say the effect I'm looking at is response to two different kinds of drug treatment - let's call their effect sizes T1 and T2.  Some studies have multiple experiments measuring  T1 and T2.  Some have one of each.  Some only have T1 or T2.

Now, in metafor, I've been using

rma(yi = logRatio, vi=varLogRatio, mods=~ Drug.Type, data=mydata)

This works fine.  Out of curiosity, I ran a quickie model in lme4

lmer(logRatio ~ Drug.Type + (1+studyID), data=mydata, weights=varLogRatio)

and I noticed that the results are quite different, and this appears due to some variation due to study (after inspecting ranef - note, I included Drug.Type as a fixed effect as there were only two levels).

So, I went back to metafor and ran

rma(yi = logRatio, vi=varLogRatio, mods=~ Drug.Type+studyID, data=mydata)

which yielded the error

Error in qr.solve(wX, diag(k)) : singular matrix 'a' in solve
In addition: Warning message:
In rma(yi = logRatio, vi = varLogRatio, data = mydata, mods = ~Drug.Type  :
  Cases with NAs omitted from model fitting.

which appears to be due to the unbalanced nature of the dataset (some studies having T1 and T2, some having multiple measures of T1 and T2).

So, is there a way to properly incorporate studyID in a metafor using rma?  Is there an argument I'm missing, or perhaps should be using a different function?

Thanks!

-Jarrett


More information about the R-help mailing list