[R-meta] mixed-effects and moderators
Reza Norouzian
rnorouz|@n @end|ng |rom gm@||@com
Thu Oct 21 02:57:43 CEST 2021
Hello Fred,
Not sure how your data looks, but here is a reproducible example where
the two methods do match.
Best,
Reza
dat <- dat.bcg
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat)
res1 <- rma(yi, vi, data=dat)
res2 <- rma(yi, vi, mods = ~ ablat, data=dat)
(R2 <- (res1$tau2 - res2$tau2) / res1$tau2)
(`METHOD ONE` <- res1$tau2 - res2$tau2 )
# [1] 0.2368886
(`METHOD TWO` <- res2$tau2 * (R2 / (1-R2)))
# [1] 0.2368886
On Wed, Oct 20, 2021 at 7:34 PM Fred Oswald <foswald using rice.edu> wrote:
>
> Your response was very helpful, thank you, Reza!
>
> METHOD ONE
> As a simple approach, you could estimate tau^2_moderators by subtracting
> (a) tau^2_residual reported in the mixed-effects model (with moderators)
> from (b) tau^2 total reported in the random effects model (no moderators).
>
> METHOD TWO
> You also could get it from R2 and the residual tau^2 reported in the
> mixed-effects model (with moderators), because:
>
> R2 = (tau^2_total - tau^2_res)/tau^2_total
> (see page 251 here:
> https://cran.r-project.org/web/packages/metafor/metafor.pdf)
>
> and that's the same thing as saying
> R2 = tau^2_moderators / (tau^2_moderators + tau^2_res)
>
> Rearranging the above, we get:
> tau^2_moderators = tau^2res * R2 / (1 - R2)
>
> The estimate of tau^2_moderators from method one vs. method two above is
> not the same for me (close, but not the same) - maybe in part due to
> rounding error, I'm not sure.
>
> Thanks again.
>
> Best,
> Fred
>
> Fred Oswald
> workforce.rice.edu | @FredOswald <https://twitter.com/FredOswald> | calendar
> <http://workforce.rice.edu/contact/>
>
>
> On Mon, Oct 18, 2021 at 9:21 PM Reza Norouzian <rnorouzian using gmail.com> wrote:
>
> > Hello Fred,
> >
> > I believe the following should be very helpful:
> > https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2021-October/003447.html
> >
> > Kind regards,
> > Reza
> >
> > On Mon, Oct 18, 2021 at 8:57 PM Fred Oswald <foswald using rice.edu> wrote:
> >
> >> Hello, and apologies if this has been addressed before: For a
> >> mixed-effects
> >> model in metafor, how does one estimate the amount of heterogeneity
> >> accounted for by continuous moderators (tau^2_mod)? Maybe use the
> >> closed-form D-L estimate from Q_M?
> >>
> >> Otherwise, deriving this from the output is not obvious to me (e.g., I2 is
> >> based on tau^2_res, and R2 assumed fixed effects).
> >>
> >> Also, presumably tau^2_total = tau^2_mod + tau^2_res…yes?
> >>
> >> Thank you for any support!
> >>
> >> Best,
> >> Fred Oswald
> >>
> >> Website | https://workforce.rice.edu
> >> Calendar | https://tinyurl.com/foswald
> >> Twitter | @FredOswald
> >> Future of Work | https://tinyurl.com/futureworking
> >> --
> >> Best,
> >> Fred Oswald
> >>
> >> Website | https://workforce.rice.edu
> >> Calendar | https://tinyurl.com/foswald
> >> Twitter | @FredOswald
> >> Future of Work | https://tinyurl.com/futureworking
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> _______________________________________________
> >> R-sig-meta-analysis mailing list
> >> R-sig-meta-analysis using r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
> >>
> >
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-meta-analysis mailing list
> R-sig-meta-analysis using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
More information about the R-sig-meta-analysis
mailing list