Skip to content

Commit c1829e0

Browse files
committed
Improve flow
1 parent 4e2acc0 commit c1829e0

1 file changed

Lines changed: 42 additions & 16 deletions

File tree

COPD-NMA.qmd

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ plot(net, weight_edges = TRUE, weight_nodes = TRUE) +
7676

7777
## Random-Effects Network Meta-Analysis
7878

79-
We first fit a random-effects model using the binomial likelihood with logit link. We use vague priors for heterogeneity and relative effects.
79+
We first fit a random-effects model using the binomial likelihood with logit link. We use weakly informative priors for heterogeneity and relative effects.
8080

8181
```{r}
8282
#| echo: true
@@ -87,23 +87,12 @@ library(dplyr)
8787
nma_consistency <- nma(
8888
net,
8989
trt_effects = "random",
90-
prior_trt = normal(scale = 10),
91-
prior_het = half_normal(scale = 5),
90+
prior_trt = normal(scale = 5),
91+
prior_het = half_normal(scale = 2.5),
9292
refresh = 0
9393
)
94-
95-
# Extract DIC
96-
dic_consistency <- dic(nma_consistency)
97-
98-
# Extract tau (posterior mean)
99-
tau_consistency <- summary(nma_consistency)$summary %>%
100-
as.data.frame() %>%
101-
filter(parameter == "tau") %>%
102-
pull(mean)
10394
```
10495

105-
We find the following estimate for tau, the between-study standard deviation: `r round(tau_consistency, 3)`. The DIC for this model is `r round(dic_consistency$dic, 1)`.
106-
10796
To complement the relative treatment effects, we summarize the probability that each treatment ranks among the best options in reducing COPD exacerbations.
10897
Cumulative rank probabilities provide a visual summary of the likelihood that a given treatment occupies each possible rank position, with higher curves indicating a higher probability of superior performance.
10998
@fig-rankprobs displays these probabilities for all treatments included in the network meta-analysis, using placebo as the reference.
@@ -120,6 +109,23 @@ db_rankprobs <- posterior_rank_probs(nma_consistency,
120109
plot(db_rankprobs)
121110
```
122111

112+
To complement the ranking results, we next assess the overall model fit and between‐study heterogeneity. Specifically, we extract the Deviance Information Criterion (DIC) and the estimated between‐study standard deviation ($\tau$) from the consistency model, which will later be compared with those from the UME model.
113+
114+
```{r}
115+
#| echo: true
116+
#| message: false
117+
#| warning: false
118+
# Extract DIC
119+
dic_consistency <- dic(nma_consistency)
120+
121+
# Extract tau (posterior mean)
122+
tau_consistency <- summary(nma_consistency)$summary %>%
123+
as.data.frame() %>%
124+
filter(parameter == "tau") %>%
125+
pull(mean)
126+
```
127+
128+
We find the following estimate for $\tau$, the between-study standard deviation: `r round(tau_consistency, 3)`. The DIC for this model is `r round(dic_consistency$dic, 1)`.
123129

124130
## Assessing Inconsistency
125131
To assess local inconsistency, we apply the node-splitting approach to each comparison with both direct and indirect evidence.
@@ -136,7 +142,14 @@ nma_inconsistency <- nma(
136142
prior_het = half_normal(scale = 2.5),
137143
refresh = 0
138144
)
145+
```
139146

147+
We can again assess the overall model fit and between‐study heterogeneity, and compare it to the resuls from the consistency model:
148+
149+
```{r}
150+
#| echo: true
151+
#| message: false
152+
#| warning: false
140153
# Extract DIC
141154
dic_inconsistency <- dic(nma_inconsistency)
142155
@@ -145,9 +158,21 @@ tau_inconsistency <- summary(nma_inconsistency)$summary %>%
145158
as.data.frame() %>%
146159
filter(parameter == "tau") %>%
147160
pull(mean)
161+
162+
# Combine into a comparison data frame
163+
model_comparison <- tibble::tibble(
164+
Model = c("Consistency", "Inconsistency (UME)"),
165+
Tau = c(tau_consistency, tau_inconsistency),
166+
DIC = c(dic_consistency$dic, dic_inconsistency$dic)
167+
)
148168
```
149169

150-
We estimated the between-study heterogeneity parameter, $\tau$, to be `r round(tau_inconsistency, 3)`. For the same model, the Deviance Information Criterion (DIC) was `r round(dic_inconsistency$dic, 1)`, providing an overall measure of model fit that balances goodness-of-fit and model complexity.
170+
```{r}
171+
#| echo: false
172+
#| message: false
173+
#| warning: false
174+
kable(model_comparison)
175+
```
151176

152177
To further explore model fit and potential inconsistency, we compared the residual deviance contributions from the consistency and UME models. Each point in the plot below represents the contribution of a study–treatment arm to the overall residual deviance. Points lying below the diagonal indicate observations that are better explained under the UME (inconsistent) model, suggesting potential sources of inconsistency.
153178

@@ -187,7 +212,8 @@ Finally, we can identify data points with substantial differences in residual de
187212
#| warning: false
188213
189214
resdev_joined %>%
190-
filter(abs(resdev_cons - resdev_ume) > 1)
215+
filter(abs(resdev_cons - resdev_ume) > 1) %>%
216+
as.data.frame()
191217
```
192218

193219
The results indicate that most studies fit both models similarly, with only the van Noord (2005) study -- specifically the Tiotropium and Formoterol arms -- showing improved fit under the UME model. This pattern points to possible local inconsistency associated with that study.

0 commit comments

Comments
 (0)