[R-meta] Difference between subset (in a loop) and mods in metafor rma.mv

Viechtbauer, Wolfgang (NP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Fri Sep 29 18:24:47 CEST 2023


Yes. For some relevant literature, see for example:

Riley, R. D., Abrams, K. R., Lambert, P. C., Sutton, A. J., & Thompson, J. R. (2007). An evaluation of bivariate random-effects meta-analysis for the joint synthesis of two correlated outcomes. Statistics in Medicine, 26(1), 78-97. https://doi.org/10.1002/sim.2524

Jackson, D., White, I. R., Price, M., Copas, J., & Riley, R. D. (2017). Borrowing of strength and study weights in multivariate and network meta-analysis. Statistical Methods in Medical Research, 26(6), 2853-2868. https://doi.org/10.1177/0962280215611702

Copas, J. B., Jackson, D., White, I. R., & Riley, R. D. (2018). The role of secondary outcomes in multivariate meta-analysis. Journal of the Royal Statistical Society, Series C, 67(5), 1177-1205. https://doi.org/10.1111/rssc.12274

Best,
Wolfgang

>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Brendan Pearl via R-sig-meta-analysis
>Sent: Friday, 29 September, 2023 13:56
>To: R Special Interest Group for Meta-Analysis
>Cc: Brendan Pearl
>Subject: Re: [R-meta] Difference between subset (in a loop) and mods in metafor
>rma.mv
>
>Thankyou Wolfgang,
>
>Just for my understanding: "When using the full dataset and using 'Predictor' as
>a moderator, then it is possible for information to be shared/borrowed from both
>levels of the moderator within studies." - is this what occurs in a
>multivariable/multivariate meta-analysis?
>
>Regards,
>Brendan.
>
>------- Original Message -------
>On Friday, September 29th, 2023 at 8:56 PM, Viechtbauer, Wolfgang (NP)
><wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
>
>> Dear Brendan,
>>
>> Both approaches fit multilevel models. The difference arises because of two
>reasons:
>>
>> 1) When using the full dataset and using 'Predictor' as a moderator, then it is
>possible for information to be shared/borrowed from both levels of the moderator
>within studies.
>>
>> 2) When subsetting based on 'Predictor', you allow the variance components to
>differ across the two levels of the moderator. This is essentially what is
>discussed here:
>>
>> https://www.metafor-project.org/doku.php/tips:comp_two_independent_estimates
>>
>> but in the context of a simpler model.
>>
>> Best,
>> Wolfgang
>>
>> > -----Original Message-----
>> > From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org]
>On
>> > Behalf Of Brendan Pearl via R-sig-meta-analysis
>> > Sent: Friday, 29 September, 2023 12:00
>> > To: r-sig-meta-analysis using r-project.org
>> > Cc: Brendan Pearl
>> > Subject: [R-meta] Difference between subset (in a loop) and mods in metafor
>> > rma.mv
>> >
>> > I am trying to understand the difference using the 'subset' and 'mods'
>options in
>> > rma.mv.
>> >
>> > I have run two analyses using rma.mv on the same dataset that has a three
>level
>> > structure (articles nested within larger studies) and get different results.
>> >
>> > In the first example I have given below, is looping over rma.mv and passing a
>> > different predictor to the subset option a univariate meta-analysis? And in
>the
>> > second example, is passing the predictor to the mods option running a
>> > multivariable meta-analysis?
>> >
>> > Study <- c("A","A","B","C","C","D","E","F","F","G")
>> > Article <- c("1","2","3","4","5","6","7","8","9","10")
>> > Predictor <- c("x","x","x","y","y","y","x","x","y","y")
>> > yi <- c(-.2,-.3,-.8,.5,.6,.4,-.1,-.8,.3,.8)
>> > vi <- c(.01,.01,.01,.01,.01,.01,.01,.01,.01,.01)
>> >
>> > dat <- data.frame(Study,Article,Predictor,yi,vi)
>> >
>> > #FIRST EXAMPLE#Subset analyses
>> > # gives me
>> >
>> > #1 x OR = -0.49 [-0.84, -0.13]
>> > #2 y OR = 0.51 [0.31, 0.72]
>> >
>> > df_subset <- data.frame(val=as.character(),subset_result=as.character())
>> >
>> > for (val in unique(dat$Predictor)){
>> >
>> > res_univariate <- rma.mv(yi=yi,
>> > V=vi,
>> > data=dat,
>> > random = ~1 | Study/Article,
>> > subset = Predictor == val,
>> > method = "REML"
>> > )
>> >
>> > result <- capture.output(cat(
>> > "OR = ",
>> > format(round(res_univariate$beta, 2),nsmall = 2),
>> > " [",
>> > format(round(res_univariate$ci.lb, 2),nsmall = 2),
>> > ", ",
>> > format(round(res_univariate$ci.ub, 2),nsmall = 2),
>> > "]",
>> > sep=""
>> > )
>> > )
>> >
>> > df_subset[nrow(df_subset) +1,] = c(
>> > val,
>> > result
>> > )
>> >
>> > }
>> >
>> > #SECOND EXAMPLE
>> > #Mod analysis
>> > #gives me:
>> >
>> > # estimate ci.lb ci.ub
>> >
>> > #factor(Predictor)x -0.4825 -0.7246 -0.2404
>> > #factor(Predictor)y 0.5807 0.3386 0.8229
>> >
>> > df_mod <- data.frame(val=as.character(),mod_result=as.character())
>> >
>> > res_multivariate <- rma.mv(yi=yi,
>> > V=vi,
>> > data=dat,
>> > random = ~1 | Study/Article,
>> > mods = ~ factor(Predictor)-1,
>> > method = "REML"
>> > )
>> > summary(res_multivariate)



More information about the R-sig-meta-analysis mailing list