[R-meta] Question about the metafor package
Safa Aouinti
@@|@@@ou|nt| @end|ng |rom y@hoo@|r
Mon Aug 17 18:14:08 CEST 2020
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
More information about the R-sig-meta-analysis
mailing list