[R] Automate multiple meta-analyses

Avraham Kluger avik at savion.huji.ac.il
Sat Feb 14 17:55:54 CET 2015


I have scores of data sets ready for meta-analyses.  I would like to run them as separate meta-analyses because otherwise I will be mixing apples with oranges.  In the code below, I successfully run a single meta-analysis with a moderator.

metacor(rho,N,Study,data=Leadership,comb.fixed=F,prediction=T,byvar=Leadership$Moderator)

To test my idea, I used the variable Moderator to try to produce separate meta analyses with either by or tapply, to no avail.  The closest I got to what I need is the code below.  It does produce separate output for each level of Moderator, but it just replicate the results without separating the data.  That is, I have k=13, and I just get the same k=13 meta-analysis for each level of Moderator.


attach(Leadership)
f<-metacor(rho,N,Study,comb.fixed=F,prediction=T)
by(Leadership,Moderator,function(x) f)

Yours,

Avi Kluger<http://pluto.huji.ac.il/~mskluger/kluger.html>


	[[alternative HTML version deleted]]



More information about the R-help mailing list