[R-meta] Interpretation of continuous moderator in 3-level meta-regression
d@@iei@i@gucci@rdi m@iii@g oii gm@ii@com
d@@iei@i@gucci@rdi m@iii@g oii gm@ii@com
Thu Sep 9 00:29:26 CEST 2021
Thanks for the recommendation and guidance Reza. Your suggestion is not something our team has discussed, so I will raise it with them to see if its within scope of the objectives for the publication.
Cheers,
Daniel
-----Original Message-----
From: Reza Norouzian <rnorouzian using gmail.com>
Sent: Thursday, 9 September 2021 2:34 AM
To: Viechtbauer, Wolfgang (SP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
Cc: daniel.f.gucciardi using gmail.com; r-sig-meta-analysis using r-project.org
Subject: Re: [R-meta] Interpretation of continuous moderator in 3-level meta-regression
CORRECTION **** Now if you do: mod1_1_btw - mod1_1_wthn, you get the contextual effect of mod1.
On Wed, Sep 8, 2021 at 1:30 PM Reza Norouzian <rnorouzian using gmail.com> wrote:
>
> Daniel,
>
> You said mod1 is coded in continuous percentage points (0.0, 0.1, 0.5,
> ..., 0.9, 1.0) or it's a binary factor variable {rows with either 0 or
> 1}? My answer may or may not be exactly what you're looking for. But
> since you linked a post that discussed this, I just offer some
> thoughts.
>
> You could potentially compute the within and between study effects of mod1.
>
> IF mod1 is in continuous percentage points:
>
> library(dplyr)
>
> new_df <-
> df %>%
> group_by(studyid) %>%
> mutate(mod1_btw_study = mean(mod1), mod1_wthn_study = mod1 -
> mod1_btw_study) %>% ungroup
>
> And then, use: mods = ~mod1_btw_study + mod1_wthn_study, data = new_df
>
> Alternatively, you could just use:
>
> mods = ~mod1_btw_study + mod1, data = new_df
>
> In the first parameterization, you can do: "mod1_btw_study -
> mod1_wthn_study" to get the contextual effect of mod1.
>
> In the second parametrization, you directly get the contextual effect
> of mod1 (via "mod1_btw_study" coefficient).
>
> Either way, the interpretation of contextual effect would then be: the
> average difference in two true row effects with the same mod1 value
> that come from studies whose average mod1 values differs by 1
> percentage point.
>
>
> IF mod1 is a binary factor, you would do the same thing but via dummy
> variables (I'm showing method 1 from above):
>
> library('fastDummies') # May be others know of a better package
>
> df$mod1 <- factor(df$mod1) # you can also rename 0 and 1 here if you
> want
>
> new_df <- df %>%
> dummy_cols(select_columns = mod1) %>%
> group_by(across(all_of(studyid))) %>%
> mutate(across(starts_with(paste0(mod1, "_")), list(wthn = ~ . -
> mean(.), btw = ~ mean(.)))) %>% ungroup
>
>
> mods = ~mod1_1_btw + mod1_1_wthn, data = new_df ## Here I'm taking
> mod1_0_btw + mod1_0_wthn as reference categories
>
> Now if you do: mod1_1_btw - mod1_1_wthn, data = new_df, you get the
> contextual effect of mod1. The interpretation this time becomes:
>
> On average, how much do two true row effects with mod1 == 1 differ if
> they come from studies whose percentage of mod1 == 1 rows differs by
> 1%.
>
> When we do contextual effect stuff with factor variables (requiring
> dummies), they are more commonly referred to as "compositional
> effects" because speaking of "studies whose percentage of mod1 == 1"
> is like asking about their composition of mod1 == 1.
>
> If you want to use the code above, please check it for typos etc.
>
> Kind regards,
> Reza
>
>
>
>
> On Wed, Sep 8, 2021 at 11:01 AM Viechtbauer, Wolfgang (SP)
> <wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
> >
> > Dear Daniel,
> >
> > Yes, that's correct.
> >
> > I would be cautious if there are no 1's in mod1 for the actual data, since you would then be extrapolating, but I assume there are, so it's all good.
> >
> > Best,
> > Wolfgang
> >
> > >-----Original Message-----
> > >From: R-sig-meta-analysis
> > >[mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of
> > >daniel.f.gucciardi using gmail.com
> > >Sent: Wednesday, 08 September, 2021 8:54
> > >To: r-sig-meta-analysis using r-project.org
> > >Subject: [R-meta] Interpretation of continuous moderator in 3-level
> > >meta- regression
> > >
> > >Hi all,
> > >
> > >I was hoping to seek your advice on the interpretation of a 3-level
> > >meta-regression with a continuous variable. Briefly, my effect size
> > >(yi) is sedentary time in minutes and moderator (mod1) is the
> > >percentage of wear time for a 24-hour period for the device used to assess sedentary behaviour.
> > >I have 55 effect sizes (esid) from 36 studies (studyid). The
> > >moderator varies among effect sizes.
> > >
> > >I have coded the moderator on a scale of 0-1; for example, if
> > >someone wore the device for 50% of the 24-hour period, we coded
> > >them as 0.50. I removed the intercept in the moderator analysis
> > >because a value of 0 for the moderator should technically equate to
> > >0 min for the effect size
> > >(https://www.metafor-project.org/doku.php/tips:models_with_or_witho
> > >ut_interc
> > >ept).
> > >
> > >library(metafor)
> > >
> > >mods_result <- rma.mv(yi, vi,
> > > data = df,
> > > level = 95,
> > > method = "REML",
> > > tdist = TRUE,
> > > mods = ~mod1-1,
> > > random = ~1 | studyid/esid)
> > >
> > >summary(mods_result)
> > >
> > >Model Results:
> > >
> > >estimate se tval df pval ci.lb ci.ub
> > >mod1 802.2315 19.6706 40.7833 54 <.0001 762.7943 841.6686
> > >***
> > >
> > >I read this post with interest
> > >(https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2021-August/003
> > >125.html) , which used chronological age as the moderator. For my
> > >case, should I interpret the estimate of approx. 802 min as the
> > >expect value for the moderator at 1 (so 100% wear time)?
> > >
> > >Cheers,
> > >Daniel
> >
> > _______________________________________________
> > R-sig-meta-analysis mailing list
> > R-sig-meta-analysis using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
>
>
> On Wed, Sep 8, 2021 at 11:02 AM Viechtbauer, Wolfgang (SP)
> <wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
> >
> > Dear Daniel,
> >
> > Yes, that's correct.
> >
> > I would be cautious if there are no 1's in mod1 for the actual data, since you would then be extrapolating, but I assume there are, so it's all good.
> >
> > Best,
> > Wolfgang
> >
> > >-----Original Message-----
> > >From: R-sig-meta-analysis
> > >[mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of
> > >daniel.f.gucciardi using gmail.com
> > >Sent: Wednesday, 08 September, 2021 8:54
> > >To: r-sig-meta-analysis using r-project.org
> > >Subject: [R-meta] Interpretation of continuous moderator in 3-level
> > >meta- regression
> > >
> > >Hi all,
> > >
> > >I was hoping to seek your advice on the interpretation of a 3-level
> > >meta-regression with a continuous variable. Briefly, my effect size
> > >(yi) is sedentary time in minutes and moderator (mod1) is the
> > >percentage of wear time for a 24-hour period for the device used to assess sedentary behaviour.
> > >I have 55 effect sizes (esid) from 36 studies (studyid). The
> > >moderator varies among effect sizes.
> > >
> > >I have coded the moderator on a scale of 0-1; for example, if
> > >someone wore the device for 50% of the 24-hour period, we coded
> > >them as 0.50. I removed the intercept in the moderator analysis
> > >because a value of 0 for the moderator should technically equate to
> > >0 min for the effect size
> > >(https://www.metafor-project.org/doku.php/tips:models_with_or_witho
> > >ut_interc
> > >ept).
> > >
> > >library(metafor)
> > >
> > >mods_result <- rma.mv(yi, vi,
> > > data = df,
> > > level = 95,
> > > method = "REML",
> > > tdist = TRUE,
> > > mods = ~mod1-1,
> > > random = ~1 | studyid/esid)
> > >
> > >summary(mods_result)
> > >
> > >Model Results:
> > >
> > >estimate se tval df pval ci.lb ci.ub
> > >mod1 802.2315 19.6706 40.7833 54 <.0001 762.7943 841.6686
> > >***
> > >
> > >I read this post with interest
> > >(https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2021-August/003
> > >125.html) , which used chronological age as the moderator. For my
> > >case, should I interpret the estimate of approx. 802 min as the
> > >expect value for the moderator at 1 (so 100% wear time)?
> > >
> > >Cheers,
> > >Daniel
> >
> > _______________________________________________
> > 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