Data was tabulated in a spreadsheet and divided in continuous and binary outcomes. Data was analyzed with the R package (R Core Team, 2016) and procesed with tydiverse package (Wickham, 2016). For continuos outcome, we used the meta package (Schwarzer, 2016) with the function metacont. The summary measure was the mean difference and their 95%CI. For binary outcomes, we used the function metabin from the meta package (Schwarzer, 2016) with the odds ratio as the summary measure and their 95%CI. Forest plot for each analysis was made.
if(!require("metafor")){install.packages("metafor")}
Loading required package: metafor
Loading required package: Matrix
Attaching package: ‘Matrix’
The following object is masked from ‘package:tidyr’:
expand
Loading 'metafor' package (version 1.9-9). For an overview
and introduction to the package please type: help(metafor).
Attaching package: ‘metafor’
The following objects are masked from ‘package:meta’:
baujat, forest, funnel, funnel.default, labbe, radial, trimfill
binary <- read.csv("binary.csv", header = T, sep = ",")
str(binary)
'data.frame': 2 obs. of 6 variables:
$ Author.Year: Factor w/ 1 level "Nascimento et al, 2016": 1 1
$ Outcome : Factor w/ 2 levels "No Bleading on probing and no attachment loss (proportion) grouping by meet fat consumtion",..: 2 1
$ n.A : int 830 766
$ p.healthy.A: int 122 201
$ n.B : int 234 300
$ p.healthy.B: int 15 26
No Bleading on probing and no attachment loss (proportion) grouping by percentago of calories from sugar consumption
binary.sugar <- binary %>%
filter(Outcome =="No Bleading on probing and no attachment loss (proportion) grouping by percentago of calories from sugar consumption")
No Bleading on probing and no attachment loss (proportion) grouping by meet fat consumtion
binary.fat <- binary %>%
filter(Outcome =="No Bleading on probing and no attachment loss (proportion) grouping by meet fat consumtion")
Fit a “normal-normal model” to the data for the two groups separately. Here, we use the logit transformed proportions (i.e., log odds) for the meta-analysis.
res <- rma(measure="PLO", xi=p.healthy.A, ni=n.A, data=binary)
print(res, digits=3)
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.255 (SE = 0.372)
tau (square root of estimated tau^2 value): 0.505
I^2 (total heterogeneity / total variability): 96.89%
H^2 (total variability / sampling variability): 32.13
Test for Heterogeneity:
Q(df = 1) = 32.131, p-val < .001
Model Results:
estimate se zval pval ci.lb ci.ub
-1.394 0.362 -3.846 <.001 -2.104 -0.684 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
The estimated average log odds (i.e., μ=-3.654 ) can be back-transformed using the inverse logit transformation with
predict(res, transf=transf.ilogit, digits=3)
pred ci.lb ci.ub cr.lb cr.ub
0.199 0.109 0.335 0.068 0.456
The 0.025 represent the median of the average risk the outcome for being exposed to the factor.
Next, the same for the group B
res1 <- rma(measure="PLO", xi=p.healthy.B, ni=n.B, data=binary)
print(res1, digits=3)
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.080)
tau (square root of estimated tau^2 value): 0
I^2 (total heterogeneity / total variability): 0.00%
H^2 (total variability / sampling variability): 1.00
Test for Heterogeneity:
Q(df = 1) = 0.938, p-val = 0.333
Model Results:
estimate se zval pval ci.lb ci.ub
-2.476 0.163 -15.221 <.001 -2.795 -2.157 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
predict(res1, transf=transf.ilogit, digits=3)
pred ci.lb ci.ub cr.lb cr.ub
0.078 0.058 0.104 0.058 0.104
Now the plots. I will use the meta package
binary.sugar.ma <- metabin(p.healthy.A, n.A, p.healthy.B, n.B,
sm="OR", method = "I", data = binary.sugar)
binary.sugar.ma
OR 95%-CI z p-value
2.5158 [1.4410; 4.3924] 3.24 0.0012
Details:
- Inverse variance method
forest(binary.sugar.ma, layout="revman5", comb.random=FALSE)
res2 <- rma(measure="PLO", xi=p.healthy.B, ni=n.B, data=binary)
print(res2, digits=3)
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.080)
tau (square root of estimated tau^2 value): 0
I^2 (total heterogeneity / total variability): 0.00%
H^2 (total variability / sampling variability): 1.00
Test for Heterogeneity:
Q(df = 1) = 0.938, p-val = 0.333
Model Results:
estimate se zval pval ci.lb ci.ub
-2.476 0.163 -15.221 <.001 -2.795 -2.157 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
predict(res2, transf=transf.ilogit, digits=3)
pred ci.lb ci.ub cr.lb cr.ub
0.078 0.058 0.104 0.058 0.104
Now the plots. I will use the meta package
binary.fat.ma <- metabin(p.healthy.A, n.A, p.healthy.B, n.B,
sm="OR", method = "I", data = binary.fat)
binary.fat.ma
OR 95%-CI z p-value
3.7491 [2.4310; 5.7819] 5.98 < 0.0001
Details:
- Inverse variance method
forest(binary.fat.ma, layout="revman5", comb.random=FALSE)
continuous <- read.csv("continuous.csv", header = T, sep = ",")
str(binary)
'data.frame': 2 obs. of 6 variables:
$ Author.Year: Factor w/ 1 level "Nascimento et al, 2016": 1 1
$ Outcome : Factor w/ 2 levels "No Bleading on probing and no attachment loss (proportion) grouping by meet fat consumtion",..: 2 1
$ n.A : int 830 766
$ p.healthy.A: int 122 201
$ n.B : int 234 300
$ p.healthy.B: int 15 26
cont.1.ma <- metacont(n.A, mean.A, sd.A, n.B, mean.B, sd.B,
data=continuous, subset = 1)
cont.1.ma
MD 95%-CI z p-value
-4.6000 [-5.0341; -4.1659] -20.77 < 0.0001
Details:
- Inverse variance method
forest(cont.1.ma)
cont.2.ma <- metacont(n.A, mean.A, sd.A, n.B, mean.B, sd.B,
data=continuous, subset = 2)
cont.2.ma
MD 95%-CI z p-value
-6.3000 [-7.0999; -5.5001] -15.44 < 0.0001
Details:
- Inverse variance method
forest(cont.2.ma)
cont.3.ma <- metacont(n.A, mean.A, sd.A, n.B, mean.B, sd.B,
data=continuous, subset = 3)
cont.3.ma
MD 95%-CI z p-value
2.0000 [0.7904; 3.2096] 3.24 0.0012
Details:
- Inverse variance method
forest(cont.3.ma)
cont.4.ma <- metacont(n.A, mean.A, sd.A, n.B, mean.B, sd.B,
data=continuous, subset = 4)
cont.4.ma
MD 95%-CI z p-value
-0.5000 [-1.5771; 0.5771] -0.91 0.3629
Details:
- Inverse variance method
forest(cont.4.ma)
citation()
To cite R in publications use:
R Core Team (2016). R: A language and environment for statistical computing. R Foundation for Statistical Computing,
Vienna, Austria. URL https://www.R-project.org/.
A BibTeX entry for LaTeX users is
@Manual{,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2016},
url = {https://www.R-project.org/},
}
We have invested a lot of time and effort in creating R, please cite it when using it for data analysis. See also
‘citation("pkgname")’ for citing R packages.
citation("tidyverse")
To cite package ‘tidyverse’ in publications use:
Hadley Wickham (2016). tidyverse: Easily Install and Load 'Tidyverse' Packages. R package version 1.0.0.
https://CRAN.R-project.org/package=tidyverse
A BibTeX entry for LaTeX users is
@Manual{,
title = {tidyverse: Easily Install and Load 'Tidyverse' Packages},
author = {Hadley Wickham},
year = {2016},
note = {R package version 1.0.0},
url = {https://CRAN.R-project.org/package=tidyverse},
}
citation("meta")
To cite package ‘meta’ in publications use:
Guido Schwarzer (2016). meta: General Package for Meta-Analysis. R package version 4.5-0.
https://CRAN.R-project.org/package=meta
A BibTeX entry for LaTeX users is
@Manual{,
title = {meta: General Package for Meta-Analysis},
author = {Guido Schwarzer},
year = {2016},
note = {R package version 4.5-0},
url = {https://CRAN.R-project.org/package=meta},
}
citation("metafor")
To cite the metafor package in publications, please use:
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3),
1-48. URL: http://www.jstatsoft.org/v36/i03/
A BibTeX entry for LaTeX users is
@Article{,
title = {Conducting meta-analyses in {R} with the {metafor} package},
author = {Wolfgang Viechtbauer},
journal = {Journal of Statistical Software},
year = {2010},
volume = {36},
number = {3},
pages = {1--48},
url = {http://www.jstatsoft.org/v36/i03/},
}