Dear all, I would like to generate a meta-regression using the function rma (package metafor)?with mods option and I have a question about how we can precise in mods the covariates in each group (TRT and control) ?? This is an extract of my data? | Study | N_TRT | N_Control | mean_TRT | SD_TRT | mean_Control | SD_Control | Age_TRT_mean | Age_TRT_SD | male_TRT_pc | Age_control_mean | Age_control_SD | male_control_pc | | [Study1, 2008] | 86 | 55 | 12.72 | 2.56 | 14.5 | 2.04 | 19.2 | 2.6 | 57 | 21.2 | 6.1 | 60 | | [Study2, 2013] | 43 | 86 | 13.4 | 0.6 | 15.3 | 0.3 | 23.5 | 3.8 | 27.9 | 29.2 | 6.7 | 46.5 | | [Study3, 2018] | 12 | 23 | 17.58 | 2.67 | 18.48 | 1.34 | 24.5 | 3.1 | 100 | 27.04 | 2.91 | 100 | | [Study4, 2015] | 675 | 264 | 31.68 | 5.3 | 33.95 | 4.48 | 18.49 | 4.25 | 57.6 | 19.77 | 4.72 | 51.5 | ........ my code is: dat1 <- escalc(measure="SMD", m1i= mean_TRT, sd1i= SD_TRT, n1i=N_TRT,? ? ? ? ? ? ? ?m2i=mean_Control, sd2i=SD_Control, n2i=N_Control, data=metadata, digits = 2) res <- metafor::rma(data = dat1,? ? ? ? ? ? ? ? ? ? yi = yi, # effect size? ? ? ? ? ? ? ? ? ? vi = vi,?? ? ? ? ? ? ? ? ? ? method = "DL",mods=~............,? ? ? ? ? ? ? ? ? ? slab = Study) I would like to precise in the meta-regression (in mods option) the age in the group TRT (Age_TRT), the age in the group control?(Age_control_pc), the percentage of males in the group TRT (male_TRT_pc) and the percentage of males in the group control (male_control_pc). Is-it possible ? or it should be treated differently ? The purpose of this meta-regression is to compare the mean difference of a medical test between two groups (treatment 'TRT' and control) and see if the age and the gender (male percentage) influence the results. Thank you in advance for your help ! Best regards.-- Safa Aouinti?Ph.D. in applied Mathematics and Statistics
[R-meta] Fw: Question about the metafor package
4 messages · Safa Aouinti, Michael Dewey, Wolfgang Viechtbauer
Dear Safa I am afraid your data is almost unreadable here. I suspect this may be because you posted in HTML and this is a plain text list so your e-mail gets scrambled. When you try again please consider using dput(insert_your_data_frame_name_here) and posting the result then we can read it in and see what you see. Michael
On 14/08/2020 16:26, Safa Aouinti wrote:
Dear all, I would like to generate a meta-regression using the function rma (package metafor)?with mods option and I have a question about how we can precise in mods the covariates in each group (TRT and control) ? This is an extract of my data | Study | N_TRT | N_Control | mean_TRT | SD_TRT | mean_Control | SD_Control | Age_TRT_mean | Age_TRT_SD | male_TRT_pc | Age_control_mean | Age_control_SD | male_control_pc | | [Study1, 2008] | 86 | 55 | 12.72 | 2.56 | 14.5 | 2.04 | 19.2 | 2.6 | 57 | 21.2 | 6.1 | 60 | | [Study2, 2013] | 43 | 86 | 13.4 | 0.6 | 15.3 | 0.3 | 23.5 | 3.8 | 27.9 | 29.2 | 6.7 | 46.5 | | [Study3, 2018] | 12 | 23 | 17.58 | 2.67 | 18.48 | 1.34 | 24.5 | 3.1 | 100 | 27.04 | 2.91 | 100 | | [Study4, 2015] | 675 | 264 | 31.68 | 5.3 | 33.95 | 4.48 | 18.49 | 4.25 | 57.6 | 19.77 | 4.72 | 51.5 | ........ my code is: dat1 <- escalc(measure="SMD", m1i= mean_TRT, sd1i= SD_TRT, n1i=N_TRT,? ? ? ? ? ? ? ?m2i=mean_Control, sd2i=SD_Control, n2i=N_Control, data=metadata, digits = 2) res <- metafor::rma(data = dat1,? ? ? ? ? ? ? ? ? ? yi = yi, # effect size? ? ? ? ? ? ? ? ? ? vi = vi,?? ? ? ? ? ? ? ? ? ? method = "DL",mods=~............,? ? ? ? ? ? ? ? ? ? slab = Study) I would like to precise in the meta-regression (in mods option) the age in the group TRT (Age_TRT), the age in the group control?(Age_control_pc), the percentage of males in the group TRT (male_TRT_pc) and the percentage of males in the group control (male_control_pc). Is-it possible ? or it should be treated differently ? The purpose of this meta-regression is to compare the mean difference of a medical test between two groups (treatment 'TRT' and control) and see if the age and the gender (male percentage) influence the results. Thank you in advance for your help ! Best regards.-- Safa Aouinti?Ph.D. in applied Mathematics and Statistics [[alternative HTML version deleted]]
_______________________________________________ R-sig-meta-analysis mailing list R-sig-meta-analysis at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
2 days later
Dear all,
I would like to generate a meta-regression using the function rma (package metafor)?with mods option and I have a question about how we can precise in mods the covariates in each group (TRT and control) ??
This is an extract of my data and my code:
metadata <- data.frame(? ?Study=factor(c("[Study1, 2008]", "[Study2, 2013]", "[Study3, 2018]", "[Study4, 2015]")),?
? ? ? ? ? ? ? ? ? ? ? ?????????????????N_TRT= c(86, 43, 12, 675),
? ? ? ? ? ? ? ? ? ? ? ?????????????????N_Control=c(55, 86, 23, 264),
? ? ? ? ? ? ? ? ? ? ? ?????????????????mean_TRT= c(12.72, 13.4, 17.58, 31.68),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SD_TRT= c(2.56, 0.6, 2.67, 5.3),
? ? ? ? ? ? ? ? ? ? ? ?????????????????mean_Control= c(14.5, 15.3, 18.48, 33.95),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SD_Control= c(2.04, 0.3, 1.34, 4.48),
? ? ? ? ? ? ? ? ? ? ? ?????????????????Age_TRT_mean= c(19.2, 23.5, 24.5, 18.49),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Age_TRT_SD= c(2.6, 3.8, 3.1, 4.25),
? ? ? ? ? ? ? ? ? ? ? ?????????????????male_TRT_pc= c(57, 27.9, 100, 57.6),
? ? ? ? ? ? ? ? ? ? ? ?????????????????Age_Control_mean= c(21.2, 29.2, 27.04, 19.77),
? ? ? ? ? ? ? ? ? ? ? ????????????????Age_Control_SD= c(6.1, 6.7, 2.91, 4.72),
? ? ? ? ? ? ? ? ? ? ? ?????????????????male_Control_pc= c(60, 46.5, 100, 51.5)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?)
dat1 <- escalc(measure="SMD", m1i= mean_TRT, sd1i= SD_TRT, n1i=N_TRT,
? ? ? ? ? ? ? ?m2i=mean_Control, sd2i=SD_Control, n2i=N_Control, data=metadata, digits = 2)
res <- metafor::rma(data = dat1,
? ? ? ? ? ? ? ? ? ? yi = yi, # effect size
? ? ? ? ? ? ? ? ? ? vi = vi,?
? ? ? ? ? ? ? ? ? ? method = "DL",mods=~............,
? ? ? ? ? ? ? ? ? ? slab = Study)
I would like to precise in the meta-regression (in mods option) the age in the group TRT (Age_TRT), the age in the group control?(Age_control_pc), the percentage of males in the group TRT (male_TRT_pc) and the percentage of males in the group control (male_control_pc). Is-it possible ? or it should be treated differently ?
The purpose of this meta-regression is to compare the mean difference of a medical test between two groups (treatment 'TRT' and control) and see if the age and the gender (male percentage) influence the results.
Thank you in advance for your help !
Best regards.
--
Safa Aouinti?
Ph.D. in applied Mathematics and Statistics
Dear Safa, You could just do: mods = ~ Age_TRT_mean + Age_Control_mean + male_TRT_pc + male_Control_pc (I think this is what you meant). Since 'yi' is a standardized mean difference here (i.e., it reflects the difference between the two groups), one could also consider a model that directly relates the size of the group difference to the *difference* in the mean age and the *difference* in the proportion of males in the two groups. That would be: mods = ~ I(Age_TRT_mean - Age_Control_mean) + I(male_TRT_pc - male_Control_pc) or you could compute these differences beforehand and then include them in the model. Best, Wolfgang
-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org]
On Behalf Of Safa Aouinti
Sent: Monday, 17 August, 2020 18:14
To: r-sig-meta-analysis at r-project.org
Subject: [R-meta] Question about the metafor package
Dear all,
I would like to generate a meta-regression using the function rma (package
metafor)?with mods option and I have a question about how we can precise in
mods the covariates in each group (TRT and control) ?
This is an extract of my data and my code:
metadata <- data.frame(? ?Study=factor(c("[Study1, 2008]", "[Study2, 2013]",
"[Study3, 2018]", "[Study4, 2015]")),
? ? ? ? ? ? ? ? ? ? ? ?????????????????N_TRT= c(86, 43, 12, 675),
? ? ? ? ? ? ? ? ? ? ? ?????????????????N_Control=c(55, 86, 23, 264),
? ? ? ? ? ? ? ? ? ? ? ?????????????????mean_TRT= c(12.72, 13.4, 17.58,
31.68),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SD_TRT= c(2.56, 0.6, 2.67, 5.3),
? ? ? ? ? ? ? ? ? ? ? ?????????????????mean_Control= c(14.5, 15.3, 18.48,
33.95),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SD_Control= c(2.04, 0.3, 1.34,
4.48),
? ? ? ? ? ? ? ? ? ? ? ?????????????????Age_TRT_mean= c(19.2, 23.5, 24.5,
18.49),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Age_TRT_SD= c(2.6, 3.8, 3.1, 4.25),
? ? ? ? ? ? ? ? ? ? ? ?????????????????male_TRT_pc= c(57, 27.9, 100, 57.6),
? ? ? ? ? ? ? ? ? ? ? ?????????????????Age_Control_mean= c(21.2, 29.2,
27.04, 19.77),
? ? ? ? ? ? ? ? ? ? ? ????????????????Age_Control_SD= c(6.1, 6.7, 2.91,
4.72),
? ? ? ? ? ? ? ? ? ? ? ?????????????????male_Control_pc= c(60, 46.5, 100,
51.5)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?)
dat1 <- escalc(measure="SMD", m1i= mean_TRT, sd1i= SD_TRT, n1i=N_TRT,
? ? ? ? ? ? ? ?m2i=mean_Control, sd2i=SD_Control, n2i=N_Control,
data=metadata, digits = 2)
res <- metafor::rma(data = dat1,
? ? ? ? ? ? ? ? ? ? yi = yi, # effect size
? ? ? ? ? ? ? ? ? ? vi = vi,
? ? ? ? ? ? ? ? ? ? method = "DL",mods=~............,
? ? ? ? ? ? ? ? ? ? slab = Study)
I would like to precise in the meta-regression (in mods option) the age in
the group TRT (Age_TRT), the age in the group control?(Age_control_pc), the
percentage of males in the group TRT (male_TRT_pc) and the percentage of
males in the group control (male_control_pc). Is-it possible ? or it should
be treated differently ?
The purpose of this meta-regression is to compare the mean difference of a
medical test between two groups (treatment 'TRT' and control) and see if the
age and the gender (male percentage) influence the results.
Thank you in advance for your help !
Best regards.
--
Safa Aouinti
Ph.D. in applied Mathematics and Statistics