[R-meta] Interaction between a continuous variable and a 3-level categorical variable
Viechtbauer, Wolfgang (NP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Fri Nov 25 00:14:40 CET 2022
Hi Roger,
This should do it:
m2 <- rma.mv(angle ~ -1 + temp*recipe, V=0, random = list(~ 1|replicate, ~ 1|ID), data=cake, test="t")
summary(m2)
anova(m2, btt="temp:recipe")
sav <- robust(m2, cluster=cake$replicate)
sav
anova(sav, btt="temp:recipe")
Best,
Wolfgang
>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Martineau, Roger (AAFC/AAC)
>Sent: Thursday, 24 November, 2022 22:22
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] Interaction between a continuous variable and a 3-level
>categorical variable
>
>Dear list-members,
>
>I have a large data set and I want to report the interaction term between a
>continuous variable and a 3-level categorical variable. My data are somewhat
>similar to the cake data set but the interactions are significant.
>
>With the example on cake, the lmer model 1 and the anova(m1) indicate that both
>the intercepts and the slopes are not different (P = 0.98 and 0.96, respectively)
>between levels of recipe (i.e. A, B and C). I use the rma.mv function and the
>robust function in my meta-analysis. The corresponding model to model 1 with
>rma.mv would be model m2 which gives the same coefficients and P-values as model
>m1. When I apply the robust function on model 2, I get the same coefficients and
>somewhat different P-values as expected.
>
>My question is: how can I get the interaction terms (P = 0.98 and 0.96; or others
>similar) from model 2 before and after using the robust function ?
>
>Best regards,
>
>Dr Roger Martineau, mv PhD
>Qu�bec, Canada
>
>str(cake)
>cake<- within(cake, {
> ID <- 1:nrow(cake)
>})
>
>m1 <- lmer(angle~-1+temp*recipe + (1|replicate), data=cake)
>summary(m1)
>anova(m1)
>
>m2 <- rma.mv(angle ~ -1 + temp*recipe, V=0, random = list(~ 1|replicate, ~ 1|ID),
>data=cake)
>summary(m2)
>robust(m2, cluster=cake$replicate)
More information about the R-sig-meta-analysis
mailing list