NCBI Bookshelf. A service of the National Library of Medicine, National Institutes of Health.

National Clinical Guideline Centre – Acute and Chronic Conditions (UK). Venous Thromboembolism: Reducing the Risk of Venous Thromboembolism (Deep Vein Thrombosis and Pulmonary Embolism) in Patients Admitted to Hospital. London: Royal College of Physicians (UK); 2010. (NICE Clinical Guidelines, No. 92.)

Cover of Venous Thromboembolism

Venous Thromboembolism: Reducing the Risk of Venous Thromboembolism (Deep Vein Thrombosis and Pulmonary Embolism) in Patients Admitted to Hospital.

Show details

Appendix IWinbugs code for Network Meta-Analysis

Random effect model template: includes correlation structure for 3-arm trials

Adapted from code to be found here:

https://www.bris.ac.uk/cobm/research/mpes/mixed-treatment-comparisons.html

Yellow highlighted sections need to be edited for each analysis.

Substitute these for the numerical values:

N = number of data points (total number of trial arms)

NS = number of studies

NT = number of treatment strategies

BR = baseline risk = event rate in arm 1

model{
sw[1] <- 0
for(i in 1:N) {
logit(p[i])<-mu[s[i]]+ delta[i] * (1-equals(t[i],b[i]))            # model
         r[i]~dbin(p[i],n[i])                                                        # binomial likelihood
         delta[i] ~ dnorm(md[i],taud[i])I(-5,5)                          # trial-specific LOR distributions
         taud[i] <- tau * (1 + equals(m[i],3) /3)                         # precisions of LOR distributions
         md[i] <- d[t[i]] - d[b[i]] + equals(m[i],3) * sw[i]                    # means of LOR distributions

#Deviance residuals for data i
          rhat[i] <- p[i] * n[i]
          dev[i] <- 2 * (r[i] * (log(r[i])-log(rhat[i])) + (n[i]-r[i]) * (log(n[i]-r[i]) - log(n[i]-rhat[i])))
          }

sumdev <- sum(dev[ ])                                                                  # Calculate residual deviance


for (i in 2:N)
{ sw[i] <- (delta[i-1] - d[t[i-1]] + d[b[i-1]])/2}                             # adjustment for 3-arm trials

for(j in 1:NS){ mu[j]~dnorm(0,.0001) }                                       # vague priors for trial baselines

d[1]<-0
for (k in 2:NT) {d[k] ~ dnorm(0,.0001) }                           # vague priors for basic parameters

sd~dunif(0,2)                                 # vague prior for random effects standard deviation
tau<-1/pow(sd,2)

rr[1]<-1
for (k in 2:NT) {logit(v[k])<-logit(BR)+d[k]
rr[k]<-v[k]/BR }                                                                         # calculate relative risk

# Pairwise ORs
for (c in 1:(NT-1))
           { for (k in (c+1):NT)
                   { lor[c,k] <- d[k] - d[c]
                      log(or[c,k]) <- lor[c,k]
                    }
    }
}

# Data from trials
s[ ]    t[ ]    r[ ]    n[ ]    b[ ]    m[ ]
Insert data here (one row for each trial arm) e.g.
1     1     79     702     1     1
1     2     80     699     1     2
END

s[ ]=Study number
t[ ]=Treatment number
r[ ]=Number of patients experiencing the event
n[ ]=Number of patients in the trial arm
b[ ]=Baseline arm (i.e. lowest treatment number within the trial)
m[ ]=Arm number in the trial

#initial values
list(
d=c(NA,-0.5,-1,-0.2),                # ensure there is one initial value for each treatment (NT)
sd=1.2,
mu=c(-2.2,-2.3,-2.4,-2.5,-2.6,    -2.2,-2.3,-2.4,-2.5,-2.6,    -2.2,-2.3,-2.4,-2.5,-2.6,    -2.2,-2.3,-2.4,-2.5,-2.6,    -2.2,-2.3,-2.4,-2.5,-2.6),
                                                  # ensure there is one initial value for each trial (NS)
delta=c(0,-0.2,-0.4,-0.6,-0.8,    0,-0.2,-0.4,-0.6,-0.8,    0,-0.2,-0.4,-0.6,-0.8,    0,-0.2,-0.4,-0.6,-0.8,    0,-0.2,-0.4,-0.6,-0.8,    0,-0.2,-0.4,-0.6,-0.8, 0,-0.2,-0.4,-0.6,-0.8,    0,-0.2,-0.4,-0.6,-0.8)
                                                   # ensure there is one initial value for each data point (N)
)
Copyright © 2010, National Clinical Guideline Centre - Acute and Chronic Conditions.

Apart from any fair dealing for the purposes of research or private study, criticism or review, as permitted under the Copyright, Designs and Patents Act, 1988, no part of this publication may be reproduced, stored or transmitted in any form or by any means, without the prior written permission of the publisher or, in the case of reprographic reproduction, in accordance with the terms of licences issued by the Copyright Licensing Agency in the UK. Enquiries concerning reproduction outside the terms stated here should be sent to the publisher at the UK address printed on this page.

The use of registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant laws and regulations and therefore for general use.

The rights of National Clinical Guideline Centre - Acute and Chronic Conditions to be identified as Author of this work have been asserted by them in accordance with the Copyright, Designs and Patents Act, 1988.

Bookshelf ID: NBK116530
PubReader format: click here to try

Views

  • PubReader
  • Print View
  • Cite this Page
  • PDF version of this title (12M)
  • Disable Glossary Links

Recent Activity

Your browsing activity is empty.

Activity recording is turned off.

Turn recording back on

See more...