-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter_11.qmd
302 lines (251 loc) · 12.9 KB
/
chapter_11.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
---
title: "Individual Participant Data Meta-analysis of clinical trials and real-world data"
authors:
- name: Pablo Verde
affiliations:
- ref: umcdusseldorf
- name: Thomas Debray
orcid: 0000-0002-1790-2719
affiliations:
- ref: smartdas
affiliations:
- id: smartdas
name: Smart Data Analysis and Statistics B.V.
city: Utrecht
- id: umcdusseldorf
name: Universitätsklinikum Düsseldorf
city: Düsseldorf
format:
html:
toc: true
number-sections: true
execute:
cache: true
bibliography: 'https://api.citedrive.com/bib/0d25b38b-db8f-43c4-b934-f4e2f3bd655a/references.bib?x=eyJpZCI6ICIwZDI1YjM4Yi1kYjhmLTQzYzQtYjkzNC1mNGUyZjNiZDY1NWEiLCAidXNlciI6ICIyNTA2IiwgInNpZ25hdHVyZSI6ICI0MGFkYjZhMzYyYWE5Y2U0MjQ2NWE2ZTQzNjlhMWY3NTk5MzhhNzUxZDNjYWIxNDlmYjM4NDgwOTYzMzY5YzFlIn0=/bibliography.bib'
---
```{r}
#| include: false
#| echo: false
#| message: false
#| warning: false
# List of required packages
required_packages <- c("ggplot2", "dplyr", "gridExtra", "mcmcplots",
"grid", "table1", "jarbes",
"gridExtra", "GGally")
# Install required packages
for (pkg in required_packages) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg)
}
}
library(kableExtra)
library(table1)
library(ggplot2)
```
## Introduction
## Hierarchical Meta-Regression
We illustrate the implementation of hierarchical meta-regression using an example that involves the following data sources:
* Aggregate data from 35 randomized trials investigating the efficacy of adjunctive treatments in managing diabetic foot problems compared with routine care
* Individual participant data from a prospective cohort study investigating patient and limb survival in patients with diabetic foot ulcers
### Aggregate data
We first retrieve the randomized evidence and summarize the treatment effect estimates using a random effects meta-analysis:
```{r}
#| warning: false
#| message: false
#| results: hide
library(dplyr)
library(jarbes)
library(meta)
data("healing")
results.ADJ <- metabin(event.c = y_c, n.c = n_c,
event.e = y_t, n.e = n_t,
studlab = Study, data = healing,
sm = "OR",
prediction = TRUE)
```
The corresponding forest plot is depicted below. The endpoint is healing without amputations within a period less than or equal to 1 year.
```{r}
#| echo: false
#| fig-width: 10
#| fig-height: 10
meta::forest(results.ADJ, leftcols = c("studlab", "n.e", "event.e", "n.c", "event.c"), rightcols = "effect.ci")
```
The random effects meta-analysis yielded a pooled odds ratio of `r sprintf("%.2f", exp(results.ADJ$TE.random))`. However, substantial between-study heterogeneity was found, with $\tau$ = `r sprintf("%.2f", results.ADJ$tau)`.
### Individual participant data
Subsequently, we retrieve the individual participant data:
```{r}
#| warning: false
data("healingipd")
IPD <- healingipd %>% dplyr::select(healing.without.amp, PAD, neuropathy,
first.ever.lesion, no.continuous.care,
male, diab.typ2, insulin, HOCHD,
HOS, CRF, dialysis, DNOAP, smoking.ever,
diabdur, wagner.class)
```
Briefly, these IPD were obtained from a prospective cohort study enrolling consecutive patients with diabetic foot ulcers (DFUs) and without previous major amputation in a single diabetes center between June 1998 and December 1999 [@morbach_long-term_2012]. The baseline characteristics of the study population are summarized below:
```{r}
#| echo: false
wagner.groups <- table(IPD$wagner.class)
IPD.and.wagner <- table(IPD$PAD, IPD$wagner.class)
dstbl <- healingipd %>% mutate(healing.without.amp = factor(healing.without.amp , levels = c(1,0), labels = c("Healing without amputation", "No healing without amputation")),
PAD = factor(PAD , levels = c(1,0), labels = c("Yes", "No")),
neuropathy = factor(neuropathy, levels = c(1,0), labels = c("Yes", "No")),
first.ever.lesion = factor(first.ever.lesion, levels = c(1,0), labels = c("Yes", "No")),
no.continuous.care = factor(no.continuous.care, levels = c(1,0), labels = c("Yes", "No")),
gender = ifelse(male == 1, "Male", "Female"),
diab.typ2 = factor(diab.typ2, levels = c(1,0), labels = c("Yes", "No")),
insulin = factor(insulin, levels = c(1,0), labels = c("Yes", "No")),
HOCHD = factor(HOCHD, levels = c(1,0), labels = c("Yes", "No")),
HOS = factor(HOS, levels = c(1,0), labels = c("Yes", "No")),
CRF = factor(CRF, levels = c(1,0), labels = c("Yes", "No")),
dialysis = factor(dialysis, levels = c(1,0), labels = c("Yes", "No")),
DNOAP = factor(DNOAP, levels = c(1,0), labels = c("Yes", "No")),
smoking.ever = factor(smoking.ever, levels = c(1,0), labels = c("Yes", "No")))
label(dstbl$healing.without.amp) <- "Healing without amputation"
label(dstbl$age) <- "Age"
label(dstbl$PAD) <- "Peripheral arterial disease"
label(dstbl$neuropathy) <- "Neuropathy"
label(dstbl$first.ever.lesion) <- "First ever lesion"
label(dstbl$no.continuous.care) <- "No continuous care"
label(dstbl$gender) <- "Sex"
label(dstbl$diab.typ2) <- "Diabetes type 2"
label(dstbl$insulin) <- "Insulin dependent"
label(dstbl$HOCHD) <- "History of coronary events (CHD)"
label(dstbl$HOS) <- "History of stroke"
label(dstbl$CRF) <- "Charcot foot syndrome"
label(dstbl$dialysis) <- "Dialysis"
label(dstbl$DNOAP) <- "DNOAP"
label(dstbl$smoking.ever) <- "Ever smoker"
label(dstbl$diabdur) <- "Diabetes duration"
label(dstbl$wagner.class) <- "Wagner score"
units(dstbl$age) <- "years"
units(dstbl$diabdur) <- "years"
table1(~ age + diabdur + gender + smoking.ever + diab.typ2 + PAD + neuropathy + first.ever.lesion +
no.continuous.care + insulin + HOCHD +
HOS + CRF + dialysis + DNOAP + wagner.class | healing.without.amp, data = dstbl)
```
As depicted above, IPD are available from `r nrow(healingipd)` patients. Some of these patients have similar characteristics to those enrolled in the randomized trials. However, other patients have comorbidities, where one or more risk factors prevent them to participate in the RCTs due to ethical reasons. For example,
`r wagner.groups[2]` patients have severe ulcer lesions (Wagner score 3 to 5), and `r IPD.and.wagner[2,2]` patients suffer from severe ulcer lesions and peripheral arterial disease (PAD). The question is: Can we generalize the benefit of adjuvant therapies observed in the RCTs to the subgroups of patients encountered in clinical practice?
### Hierarchical metaregression
We first investigate the event rate of patients receiving routine care:
```{r}
#| warning: false
#| message: false
#| echo: false
#| fig-width: 10
#| fig-height: 10
healingplus <- healing %>% dplyr::select(Study, y_c, n_c) %>%
mutate("Source" = "RCT", cil = NA, ciu = NA) %>%
add_row(data.frame(Study = "Morbach 2012",
y_c = nrow(healingipd %>% filter(healing.without.amp==1)),
n_c = nrow(healingipd),
Source = "RWD")) %>%
mutate(prop = y_c/n_c) %>%
arrange(prop)
for (i in seq(nrow(healingplus))) {
proptest <- prop.test(x = healingplus$y_c[i], n = healingplus$n_c[i], correct=FALSE)
healingplus$cil[i] <- proptest$conf.int[1]
healingplus$ciu[i] <- proptest$conf.int[2]
}
ggplot(healingplus, aes(x=prop, y=reorder(Study, prop))) +
geom_errorbar(aes(xmin = cil, xmax = ciu, color = Source)) +
geom_point(aes(color = Source)) +
xlab("Recovery within one year (%)") +
ylab("")+
theme(legend.position = "bottom") +
scale_x_continuous(labels = scales::percent)
```
The forest plot above indicates that the baseline risk in the observational study from Morbach et al. is much higher than most trials.
We fitted an HMR model to the available RWD and published AD:
```{r hmr_fit}
#| message: false
#| warning: false
#| results: hide
set.seed(2022)
AD <- healing %>% dplyr::select(yc = y_c, nc = n_c,
yt = y_t, nt = n_t, Study = Study)
mx2 <- hmr(data = AD, # Published aggregate data
two.by.two = FALSE, #
dataIPD = IPD, # Data frame of the IPD
re = "sm", # Random effects model: "sm" scale mixtures
link = "logit", # Link function of the random effects
sd.mu.1 = 1, # Scale parameter for the prior of mu.1
sd.mu.2 = 1, # Scale parameter for the prior of mu.2
sd.mu.phi = 1, # Scale parameter for the prior of mu.phi
sigma.1.upper = 5, # Upper bound of the prior of sigma.1
sigma.2.upper = 5, # Upper bound of the prior of sigma.2
sigma.beta.upper = 5, # Upper bound of the prior of sigma.beta
sd.Fisher.rho = 1.25, # Scale parameter for the prior of rho
df.estimate = TRUE, # If TRUE the degrees of freedom are estimated
df.lower = 3, # Lower bound of the df's prior
df.upper = 10, # Upper bound of the df's prior
nr.chains = 2, # Number of MCMC chains
nr.iterations = 10000, # Total number of iterations
nr.adapt = 1000, # Number of iteration for burnin
nr.thin = 1) # Thinning rate
```
We start our analysis by visualizing the conflict of evidence between the different types of data and study types. The figure below depicts the posterior distribution of $\mu_{\phi}$, which is the mean bias of the IPD-NRS compared to the AD-RCTs control groups. The posterior distribution has a substantial probability mass below zero, which indicates that in average the IPD-NRS patients present a better prognoses than the AD-RCTs control groups. That means that taking the IPD-NRS results at face value would be misleading if we aim to combine them with a meta-analysis of AD-RCTs.
```{r}
#| fig.cap: Conflict of evidence analysis. The left panel shows the prior to posterior sensitivity analysis of bias mean between the RCTs and the IPD-NRS. The right panel depicts the posterior distribution of the outliers detection weights.
#| echo: false
#| message: false
#| warning: false
#| results: hide
#| fig.width: 11
#| fig.height: 10
# Diagnostic plot
mu.phi <- mx2$BUGSoutput$sims.list$mu.phi
mean.mu.phi <- mx2$prior$mean.mu.phi
sd.mu.phi <- mx2$prior$sd.mu.phi
df.mu.phi <- data.frame(x = mu.phi, dist = "Posterior")
ggplot(df.mu.phi, aes(x = x, colour = "Posterior")) +
geom_density() +
geom_histogram(aes(y = after_stat(density)), fill = "gray", alpha = 0.3, bins = 60) +
geom_vline(xintercept = mean.mu.phi, linewidth = 0.5, lty = 2) +
#geom_vline(xintercept = mean(mu.phi), aes(col = 'Posterior'), size = 1, lty = 2) +
stat_function(fun = dlogis, n = 101,
args = list(location = mean.mu.phi, scale = sd.mu.phi), size = 0.5, aes(color='Prior')) +
labs(x = expression(mu[phi]), y = "Density", color = "Density") +
scale_color_manual(name='',
breaks=c('Prior', 'Posterior'),
values=c('Prior'='black', 'Posterior'='gray')) +
guides(color = guide_legend(override.aes = list(fill = NA))) +
xlim(c(-10, 10)) + theme_bw() +
theme(
legend.position = "bottom" # Move the legend to the bottom
)
```
The figure below presents the posterior distribution of the weights $w_{i}$ for each study included in the HMR. These posteriors are summarized using a forest plot, where posterior intervals substantially greater than one indicate outliers. One important aspect of the HMR is that those outliers are automatically down-weighted in the analysis.
```{r}
#| fig.cap: Posterior distribution of the weights for each study included in the HMR
#| echo: false
#| message: false
#| results: hide
#| fig.width: 11
#| fig.height: 10
w <- mx2$BUGSoutput$sims.list$w
w.s <- apply(w, 2, median)
w.u <- apply(w, 2, quantile, prob = 0.75)
w.l <- apply(w, 2, quantile, prob = 0.25)
n.studies <- length(w.s)
w.col <- ifelse(w.s < 1.5, "grey", "red")
w.col[length(w.s)] <- "black"
study.names = c(as.character(mx2$data$Study), "RWD (Morbach 2012)")
dat.weights = data.frame(x = study.names, y = w.s, ylo = w.l, yhi = w.u)
ggplot(dat.weights, aes(x = x, y = y,
ymin = ylo, ymax = yhi, size = 0.5)) +
geom_pointrange(colour = w.col, lwd = 1, shape = 23, size = 0.3) + coord_flip() +
geom_hline(yintercept = 1, lty = 2) + xlab("Study") +
ylab("Outlier detection weight") +
theme_bw() +
scale_y_log10()
```
## Version info {.unnumbered}
This chapter was rendered using the following version of R and its packages:
```{r}
#| echo: false
#| message: false
#| warning: false
sessionInfo()
```
## References {.unnumbered}