Exercises from Doctrine UK Workshop: A Beginner’s Guide to the Meta-Analysis in R by Christ Billy Aryanto
library(tidyverse)
library(esc)
library(meta)
data <- read_delim("fileLatihan.csv", delim = ";")
Rows: 10 Columns: 8── Column specification ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ";"
chr (2): Study, Moderator
dbl (6): N1, M1, SD1, N2, M2, SD2
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
data
n_exp <- 103
n_con <- 109
mean_exp <- 135.81
sd_exp <- 18.72
mean_con <- 123.18
sd_con <- 19.39
esc_mean_sd(grp1m = mean_exp, grp1sd = sd_exp, grp1n = n_exp,
grp2m = mean_con, grp2sd = sd_con, grp2n = n_con,
es.type = "d")
Effect Size Calculation for Meta Analysis
Conversion: mean and sd to effect size d
Effect Size: 0.6624
Standard Error: 0.1411
Variance: 0.0199
Lower CI: 0.3858
Upper CI: 0.9390
Weight: 50.2062
data.es <- esc_mean_sd(grp1m = data$M1, grp1sd = data$SD1, grp1n = data$N1,
grp2m = data$M2, grp2sd = data$SD2, grp2n = data$N2,
es.type = "d", study = data$Study) %>%
as.data.frame() %>%
inner_join(data %>% select(Study,Moderator), by=c("study"="Study"))
data.es
model1 <- metagen(data = data.es, TE = es, seTE = se,
studlab = study, sm = "SMD", common = T, random = T,
method.tau = "REML", title = "Latihan Meta-Analysis")
summary(model1)
Review: Latihan Meta-Analysis
SMD 95%-CI %W(common) %W(random)
Burhman et al (2013) 0.7036 [ 0.2403; 1.1670] 6.3 10.3
Fledderus et al (2012) 1.0863 [ 0.8213; 1.3513] 19.1 13.2
Gluck & Maerker (2011) -0.3158 [-0.8851; 0.2534] 4.1 8.9
Hesser et all (2012) 0.7222 [ 0.2204; 1.2241] 5.3 9.8
Hjeff/Hayes (2012) 0.6624 [ 0.3858; 0.9390] 17.5 13.1
Johnson et al (2012) 0.7355 [-0.4171; 1.8881] 1.0 3.8
Lappalainen et al (2013) 0.2543 [-0.5491; 1.0577] 2.1 6.3
Morledge et al (2013) 0.2454 [ 0.0403; 0.4505] 31.9 14.0
Muto et al (2011) 0.1061 [-0.3962; 0.6084] 5.3 9.8
Thorsell et al (2011) 0.6097 [ 0.1821; 1.0374] 7.3 10.9
Number of studies combined: k = 10
SMD 95%-CI z p-value
Common effect model 0.5344 [0.4186; 0.6503] 9.04 < 0.0001
Random effects model 0.5007 [0.2396; 0.7619] 3.76 0.0002
Quantifying heterogeneity:
tau^2 = 0.1159 [0.0271; 0.4769]; tau = 0.3405 [0.1646; 0.6906]
I^2 = 76.5% [56.5%; 87.3%]; H = 2.06 [1.52; 2.80]
Test of heterogeneity:
Q d.f. p-value
38.22 9 < 0.0001
Details on meta-analytical method:
- Inverse variance method
- Restricted maximum-likelihood estimator for tau^2
- Q-Profile method for confidence interval of tau^2 and tau
forest.meta(model1,
leftcols = c("study", "es", "se", "Moderator"),
leftlabs = c("Author", "d", "SE", "Moderator"),
sortvar = es)
model2 <- metagen(data = data.es, TE = es, seTE = se, studlab = study,
sm = "SMD", common = T, random = T,
method.tau = "REML", subgroup = Moderator,
title = "Latihan Meta-Analysis")
summary(model2)
Review: Latihan Meta-Analysis
SMD 95%-CI %W(common) %W(random) Moderator
Burhman et al (2013) 0.7036 [ 0.2403; 1.1670] 6.3 10.3 INTERNET
Fledderus et al (2012) 1.0863 [ 0.8213; 1.3513] 19.1 13.2 BOOK
Gluck & Maerker (2011) -0.3158 [-0.8851; 0.2534] 4.1 8.9 INTERNET
Hesser et all (2012) 0.7222 [ 0.2204; 1.2241] 5.3 9.8 INTERNET
Hjeff/Hayes (2012) 0.6624 [ 0.3858; 0.9390] 17.5 13.1 BOOK
Johnson et al (2012) 0.7355 [-0.4171; 1.8881] 1.0 3.8 BOOK
Lappalainen et al (2013) 0.2543 [-0.5491; 1.0577] 2.1 6.3 INTERNET
Morledge et al (2013) 0.2454 [ 0.0403; 0.4505] 31.9 14.0 INTERNET
Muto et al (2011) 0.1061 [-0.3962; 0.6084] 5.3 9.8 BOOK
Thorsell et al (2011) 0.6097 [ 0.1821; 1.0374] 7.3 10.9 BOOK
Number of studies combined: k = 10
SMD 95%-CI z p-value
Common effect model 0.5344 [0.4186; 0.6503] 9.04 < 0.0001
Random effects model 0.5007 [0.2396; 0.7619] 3.76 0.0002
Quantifying heterogeneity:
tau^2 = 0.1159 [0.0271; 0.4769]; tau = 0.3405 [0.1646; 0.6906]
I^2 = 76.5% [56.5%; 87.3%]; H = 2.06 [1.52; 2.80]
Test of heterogeneity:
Q d.f. p-value
38.22 9 < 0.0001
Results for subgroups (common effect model):
k SMD 95%-CI Q I^2
Moderator = INTERNET 5 0.3078 [0.1434; 0.4721] 10.41 61.6%
Moderator = BOOK 5 0.7583 [0.5950; 0.9217] 13.29 69.9%
Test for subgroup differences (common effect model):
Q d.f. p-value
Between groups 14.53 1 0.0001
Within groups 23.69 8 0.0026
Results for subgroups (random effects model):
k SMD 95%-CI tau^2 tau
Moderator = INTERNET 5 0.3370 [-0.0193; 0.6934] 0.1019 0.3191
Moderator = BOOK 5 0.6640 [ 0.3195; 1.0085] 0.0977 0.3126
Test for subgroup differences (random effects model):
Q d.f. p-value
Between groups 1.67 1 0.1960
Details on meta-analytical method:
- Inverse variance method
- Restricted maximum-likelihood estimator for tau^2
- Q-Profile method for confidence interval of tau^2 and tau
forest.meta(model2,
leftcols = c("study", "es", "se", "Moderator"),
leftlabs = c("Author", "d", "SE", "Moderator"),
sortvar = es)