Skip to content

Commit 2bc2d7a

Browse files
committed
Amend binary outcome section.
1 parent 1d0d2a8 commit 2bc2d7a

23 files changed

+10809
-7110
lines changed

01-rstudio_and_basics.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RStudio & Basics
22

3-
![](/Users/Mathias2/Documents/R/WORKING_DIRECTORY/Windows/R/WORKING_DIRECTORY/Meta-Analyse Buch/bookdown-demo-master/chap2.jpg)
3+
![](chap2.jpg)
44

55
```{block,type='rmdinfo'}
66
Before we start with our meta-analysis, we have to download and prepare a **computer program** which allows us to use *R* for programming.
@@ -22,7 +22,7 @@ Especially if you have **never used R before, we would like to consider this Cha
2222
```{r, echo=FALSE, fig.width=3,fig.height=2}
2323
library(png)
2424
library(grid)
25-
img <- readPNG("C:/Users/Admin/Documents/R/WORKING_DIRECTORY/Meta-Analyse Buch/bookdown-demo-master/rstudiologo.PNG")
25+
img <- readPNG("rstudiologo.PNG")
2626
grid.raster(img)
2727
```
2828

02-getting_data_in_R.Rmd

Lines changed: 302 additions & 302 deletions
Large diffs are not rendered by default.

03-pooling_effect_sizes.Rmd

Lines changed: 583 additions & 480 deletions
Large diffs are not rendered by default.

04-forest_plots.Rmd

Lines changed: 169 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,169 @@
1-
# Forest Plots
2-
3-
![](C:/Users/Admin/Documents/R/WORKING_DIRECTORY/Meta-Analyse Buch/bookdown-demo-master/forest.jpg)
4-
5-
```{block,type='rmdinfo'}
6-
Now that we created the **output of our meta-analysis** using the `metagen`, `metacont` or `metabin` functions in `meta` (see [Chapter 4.1](#fixed),[Chapter 4.2](#random) and [Chapter 4.3](#binary)), it is time to present the data in a more digestable way.
7-
8-
**Forest Plots** are an easy way to do this, and it is conventional to report forest plots in meta-analysis publications.
9-
```
10-
11-
<br><br>
12-
13-
---
14-
15-
## Generating a Forest Plot
16-
17-
To produce a forest plot, we use the meta-analysis output we just created (e.g., `m`, `m.raw`) und the `meta::forest()` function. I'll use my `m.hksj.raw` output from [Chapter 4.2.3](#random.raw) to create the forest plot
18-
19-
```{r,echo=FALSE,warning=FALSE,message=FALSE}
20-
load("metacont_data.RData")
21-
metacont$Ne<-as.numeric(metacont$Ne)
22-
metacont$Me<-as.numeric(metacont$Me)
23-
metacont$Se<-as.numeric(metacont$Se)
24-
metacont$Mc<-as.numeric(metacont$Mc)
25-
metacont$Sc<-as.numeric(metacont$Sc)
26-
library(meta)
27-
library(metafor)
28-
m.hksj.raw<-metacont(Ne,
29-
Me,
30-
Se,
31-
Nc,
32-
Mc,
33-
Sc,
34-
data=metacont,
35-
studlab=paste(Author),
36-
comb.fixed = FALSE,
37-
comb.random = TRUE,
38-
method.tau = "SJ",
39-
hakn = TRUE,
40-
prediction=TRUE,
41-
sm="SMD")
42-
metacont$intervention.type<-c("PCI","PCI","Mindfulness","CBT","CBT","CBT")
43-
```
44-
45-
```{r,fig.width=11,fig.height=4,fig.align='center'}
46-
forest(m.hksj.raw)
47-
```
48-
49-
Looks good so far. We see that the function plotted a forest plot with a **diamond** (i.e. the overall effect and its confidence interval) and a **prediction interval**.
50-
51-
There are plenty of **other parameters** within the `meta::forest` function which we can use to modify the forest plot.
52-
53-
```{r,echo=FALSE}
54-
library(knitr)
55-
library(grid)
56-
load("foresttable.RData")
57-
kable(foresttable)
58-
```
59-
60-
This is again just an overview. For all settings, type `?meta::forest` in your **console** to see more.
61-
62-
Let's play around with the function a little now:
63-
64-
```{r,fig.width=9,fig.height=3.5,fig.align='center'}
65-
forest(m.hksj.raw,
66-
sortvar=TE,
67-
xlim = c(-1.5,0.5),
68-
rightlabs = c("g","95% CI","weight"),
69-
leftlabs = c("Author", "N","Mean","SD","N","Mean","SD"),
70-
lab.e = "Intervention",
71-
pooled.totals = FALSE,
72-
smlab = "",
73-
text.random = "Overall effect",
74-
print.tau2 = FALSE,
75-
col.diamond = "blue",
76-
col.diamond.lines = "black",
77-
col.predict = "black",
78-
print.I2.ci = TRUE,
79-
digits.sd = 2
80-
)
81-
82-
```
83-
84-
Looks good so far! For special **layout types**, proceed to [Chapter 5.2](#layouttypes) now.
85-
86-
<br><br>
87-
88-
---
89-
90-
91-
## Layout types {#layouttypes}
92-
93-
The `meta::forest` function also has two **Layouts** preinstalled which we can use. Those layouts can be accessed with the `layout=` parameter.
94-
95-
* **"RevMan5"**. This layout is used for Cochrane reviews and generated by *Review Manager 5*.
96-
* **"JAMA"**. This layout gives you a forest plot according to the guidelines of the *Journal of the American Medical Association* as output (see details [here](https://jamanetwork.com/journals/jama/pages/instructions-for-authors)).
97-
98-
The **RevMan** layout looks like this:
99-
100-
```{r,fig.width=10,fig.height=4,fig.align='center'}
101-
forest(m.hksj.raw,
102-
layout = "RevMan5",
103-
digits.sd = 2)
104-
105-
```
106-
The **JAMA** layout looks like this:
107-
108-
```{r,fig.width=7,fig.height=3,fig.align='center'}
109-
forest(m.hksj.raw,
110-
layout = "JAMA",
111-
text.predict = "95% PI",
112-
col.predict = "black",
113-
colgap.forest.left = unit(15,"mm"))
114-
```
115-
116-
<br><br>
117-
118-
---
119-
120-
## Saving the forest plots
121-
122-
Let's say i want to save the JAMA version of my Forest Plot now. To do this, i have to reuse the code with which i plotted my forest plot, and put it between `pdf(file='name_of_the_pdf_i_want_to_create.pdf')` and `dev.off`, both in separate lines. This saves the plot into a PDF in my Working Directory.
123-
124-
This way, i can export the plot in different formats (you can find more details on the saving options [here](#saving)).
125-
126-
<br></br>
127-
128-
**PDF**
129-
130-
```{r, eval=FALSE}
131-
pdf(file='forestplot.pdf')
132-
forest.jama<-forest(m.hksj.raw,
133-
layout = "JAMA",
134-
text.predict = "95% PI",
135-
col.predict = "black",
136-
colgap.forest.left = unit(15,"mm"))
137-
dev.off()
138-
```
139-
140-
**PNG**
141-
142-
```{r, eval=FALSE}
143-
png(file='forestplot.png')
144-
forest.jama<-forest(m.hksj.raw,
145-
layout = "JAMA",
146-
text.predict = "95% PI",
147-
col.predict = "black",
148-
colgap.forest.left = unit(15,"mm"))
149-
dev.off()
150-
```
151-
152-
**Scalable Vector Graphic**
153-
154-
```{r, eval=FALSE}
155-
svg(file='forestplot.svg')
156-
forest.jama<-forest(m.hksj.raw,
157-
layout = "JAMA",
158-
text.predict = "95% PI",
159-
col.predict = "black",
160-
colgap.forest.left = unit(15,"mm"))
161-
dev.off()
162-
```
163-
164-
165-
<br><br>
166-
167-
---
168-
169-
1+
# Forest Plots
2+
3+
![](forest.jpg)
4+
5+
```{block,type='rmdinfo'}
6+
Now that we created the **output of our meta-analysis** using the `metagen`, `metacont` or `metabin` functions in `meta` (see [Chapter 4.1](#fixed),[Chapter 4.2](#random) and [Chapter 4.3](#binary)), it is time to present the data in a more digestable way.
7+
8+
**Forest Plots** are an easy way to do this, and it is conventional to report forest plots in meta-analysis publications.
9+
```
10+
11+
<br><br>
12+
13+
---
14+
15+
## Generating a Forest Plot
16+
17+
To produce a forest plot, we use the meta-analysis output we just created (e.g., `m`, `m.raw`) und the `meta::forest()` function. I'll use my `m.hksj.raw` output from [Chapter 4.2.3](#random.raw) to create the forest plot
18+
19+
```{r,echo=FALSE,warning=FALSE,message=FALSE}
20+
load("metacont_data.RData")
21+
metacont$Ne<-as.numeric(metacont$Ne)
22+
metacont$Me<-as.numeric(metacont$Me)
23+
metacont$Se<-as.numeric(metacont$Se)
24+
metacont$Mc<-as.numeric(metacont$Mc)
25+
metacont$Sc<-as.numeric(metacont$Sc)
26+
library(meta)
27+
library(metafor)
28+
m.hksj.raw<-metacont(Ne,
29+
Me,
30+
Se,
31+
Nc,
32+
Mc,
33+
Sc,
34+
data=metacont,
35+
studlab=paste(Author),
36+
comb.fixed = FALSE,
37+
comb.random = TRUE,
38+
method.tau = "SJ",
39+
hakn = TRUE,
40+
prediction=TRUE,
41+
sm="SMD")
42+
metacont$intervention.type<-c("PCI","PCI","Mindfulness","CBT","CBT","CBT")
43+
```
44+
45+
```{r,fig.width=11,fig.height=4,fig.align='center'}
46+
forest(m.hksj.raw)
47+
```
48+
49+
Looks good so far. We see that the function plotted a forest plot with a **diamond** (i.e. the overall effect and its confidence interval) and a **prediction interval**.
50+
51+
There are plenty of **other parameters** within the `meta::forest` function which we can use to modify the forest plot.
52+
53+
```{r,echo=FALSE}
54+
library(knitr)
55+
library(grid)
56+
load("foresttable.RData")
57+
kable(foresttable)
58+
```
59+
60+
This is again just an overview. For all settings, type `?meta::forest` in your **console** to see more.
61+
62+
Let's play around with the function a little now:
63+
64+
```{r,fig.width=9,fig.height=3.5,fig.align='center'}
65+
forest(m.hksj.raw,
66+
sortvar=TE,
67+
xlim = c(-1.5,0.5),
68+
rightlabs = c("g","95% CI","weight"),
69+
leftlabs = c("Author", "N","Mean","SD","N","Mean","SD"),
70+
lab.e = "Intervention",
71+
pooled.totals = FALSE,
72+
smlab = "",
73+
text.random = "Overall effect",
74+
print.tau2 = FALSE,
75+
col.diamond = "blue",
76+
col.diamond.lines = "black",
77+
col.predict = "black",
78+
print.I2.ci = TRUE,
79+
digits.sd = 2
80+
)
81+
82+
```
83+
84+
Looks good so far! For special **layout types**, proceed to [Chapter 5.2](#layouttypes) now.
85+
86+
<br><br>
87+
88+
---
89+
90+
91+
## Layout types {#layouttypes}
92+
93+
The `meta::forest` function also has two **Layouts** preinstalled which we can use. Those layouts can be accessed with the `layout=` parameter.
94+
95+
* **"RevMan5"**. This layout is used for Cochrane reviews and generated by *Review Manager 5*.
96+
* **"JAMA"**. This layout gives you a forest plot according to the guidelines of the *Journal of the American Medical Association* as output (see details [here](https://jamanetwork.com/journals/jama/pages/instructions-for-authors)).
97+
98+
The **RevMan** layout looks like this:
99+
100+
```{r,fig.width=10,fig.height=4,fig.align='center'}
101+
forest(m.hksj.raw,
102+
layout = "RevMan5",
103+
digits.sd = 2)
104+
105+
```
106+
The **JAMA** layout looks like this:
107+
108+
```{r,fig.width=7,fig.height=3,fig.align='center'}
109+
forest(m.hksj.raw,
110+
layout = "JAMA",
111+
text.predict = "95% PI",
112+
col.predict = "black",
113+
colgap.forest.left = unit(15,"mm"))
114+
```
115+
116+
<br><br>
117+
118+
---
119+
120+
## Saving the forest plots
121+
122+
Let's say i want to save the JAMA version of my Forest Plot now. To do this, i have to reuse the code with which i plotted my forest plot, and put it between `pdf(file='name_of_the_pdf_i_want_to_create.pdf')` and `dev.off`, both in separate lines. This saves the plot into a PDF in my Working Directory.
123+
124+
This way, i can export the plot in different formats (you can find more details on the saving options [here](#saving)).
125+
126+
<br></br>
127+
128+
**PDF**
129+
130+
```{r, eval=FALSE}
131+
pdf(file='forestplot.pdf')
132+
forest.jama<-forest(m.hksj.raw,
133+
layout = "JAMA",
134+
text.predict = "95% PI",
135+
col.predict = "black",
136+
colgap.forest.left = unit(15,"mm"))
137+
dev.off()
138+
```
139+
140+
**PNG**
141+
142+
```{r, eval=FALSE}
143+
png(file='forestplot.png')
144+
forest.jama<-forest(m.hksj.raw,
145+
layout = "JAMA",
146+
text.predict = "95% PI",
147+
col.predict = "black",
148+
colgap.forest.left = unit(15,"mm"))
149+
dev.off()
150+
```
151+
152+
**Scalable Vector Graphic**
153+
154+
```{r, eval=FALSE}
155+
svg(file='forestplot.svg')
156+
forest.jama<-forest(m.hksj.raw,
157+
layout = "JAMA",
158+
text.predict = "95% PI",
159+
col.predict = "black",
160+
colgap.forest.left = unit(15,"mm"))
161+
dev.off()
162+
```
163+
164+
165+
<br><br>
166+
167+
---
168+
169+

05-heterogeneity.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Between-study Heterogeneity {#heterogeneity}
22

3-
![](C:/Users/Admin/Documents/R/WORKING_DIRECTORY/Meta-Analyse Buch/bookdown-demo-master/schiffchen.jpg)
3+
![](schiffchen.jpg)
44

55
By now, we have already shown you how to pool effect sizes in a meta-analysis. In meta-analytic pooling, we aim to **synthesize the effects of many different studies into one single effect**. However, this makes only sense if we aren't comparing **Apples and Oranges**. For example, it could be the case that while the overall effect we calculate in the meta-analysis is **small**, there are still a few studies which report **very high** effect sizes. Such information is lost in the aggregate effect, but it is very important to know if all studies, or interventions, yield small effect sizes, or if there are exceptions.
66

0 commit comments

Comments
 (0)