[R] Correlating multiple effect sizes within a study to study-level predictors: metafor package

Michael Dewey info at aghmed.fsnet.co.uk
Mon Jul 14 14:42:13 CEST 2014


At 23:18 11/07/2014, Megan Bartlett wrote:
>Hi everyone,
>
>Since metafor doesn't have its own list, I hope this is the correct place
>for this posting- my apologies if there is a more appropriate list.

metafor questions welcome here, Megan

Wolfgang seems to be off-list so while we wait for the definitive 
answer here are some hints.


>I'm conducting a meta-analysis where I would like to determine the
>correlation between plasticity in leaf traits and climate. I'm calculating
>effect sizes as Hedge's d. My data is structured so that each study
>collected data from one forest site, so there is one set of climate
>variable values for that study, and there are one or more species in each
>study, so all the species in a study have the same values for the climate
>variables. I'm not sure how to account for this structure in modeling the
>relationship between plasticity and climate.

I think you need rma.mv for your situation and you need to specify a 
random effect for site.

Try going
?rma.mv
and looking for the section entitled Specifying random effects
  You will need to set up your dataframe with one row per species and 
an indicator variable for site and then use
random = ~ 1 | site

Not tested obviously and Wolfgang may have other suggestions

>My first thought was to calculate mean effect size and variance across
>species for every study with multiple species and correlate that    with
>the climate variable values for those study with the rma() function, but
>trying to do that returns an error message:
>
>rma(yi = EffectSize, vi = Var, data = sitestable, mod = Precip)
>returns: Error in wi * (yi - X %*% b)^2 : non-conformable arrays
>
>This leaves me with two questions: 1) Am I even accounting for the data
>structure correctly with this approach, and 2) am I fundamentally
>misunderstanding how to use metafor to do so?
>
>Thanks very much for your help!
>
>Best,
>
>Megan
>
>         [[alternative HTML version deleted]]

Michael Dewey
info at aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html



More information about the R-help mailing list