Hips model 4: Comparative analysis of Stanmore & Charnley incorporating evidence

Spiegelhalter, D.J. and Best, N.G. “Bayesian approaches to multiple sources of evidence and uncertainty in complex cost-effectiveness modelling”. Statistics in Medicine 22, (2003), 3687-3709.
n = 10000 updates (1 per simulated set of parameter values) are required for this model;
For hazard ratio estimates in bottom of table 4, monitor HR. For results in table 5, monitor C.incr, BQ.incr, ICER.strata, mean.C.incr, mean.BQ.incr, mean.ICER, P.CEA.strata[30,],
P.CEA.strata[50,], P.CEA[30] and P.CEA[50]. To produce plots in Fig 2, use coda option to save samples of C.incr, BQ.incr, mean.C.incr, mean.BQ.incr. To produce plots in Fig 3, set summary monitors on P.CEA.strata and P.CEA to get posterior means

Sections of the code that have changed from Model 1 are shown in bold
model {

# Evidence
#########

for (i in 1 : M){ # loop over studies
rC[i] ~ dbin(pC[i], nC[i]) # number of revisions on Charnley
rS[i] ~ dbin(pS[i], nS[i]) # number of revisions on Stanmore
cloglog(pC[i]) <- base[i] - logHR[i]/2
cloglog(pS[i]) <- base[i] + logHR[i]/2
base[i] ~ dunif(-100,100)
# log hazard ratio for ith study
logHR[i] ~ dnorm(LHR,tauHR[i])
tauHR[i] <- qualweights[i] * tauh # precision for ith study weighted by quality weights
}
LHR ~ dunif(-100,100)
log(HR) <- LHR
tauh <- 1 / (sigmah * sigmah)
sigmah ~ dnorm( 0.2, 400)T(0, ) # between-trial sd = 0.05 (prior constrained to be positive)

for(k in 1 : K) {
logh[k] ~ dnorm(logh0[k], tau)
h[1, k] <- exp(logh[k]) # revision hazard for Charnley
h[2, k] <- HR * h[1, k] # revision hazard for Stanmore
}# Cost-effectiveness model
######################

for(k in 1 : K) { # loop over strata

for(n in 1 : 2) { # loop over protheses
# Cost and benefit equations in closed form:
####################################

# Costs
for(t in 1 : N) {
   ct[n, k, t] <- inprod(pi[n, k, t, ], c[n, ]) / pow(1 + delta.c, t - 1)
}
C[n,k] <- C0[n] + sum(ct[n, k, ])

# Benefits - life expectancy
for(t in 1 : N) {
   blt[n, k, t] <- inprod(pi[n, k, t, ], bl[]) / pow(1 + delta.b, t - 1)
}
BL[n, k] <- sum(blt[n, k, ])

# Benefits - QALYs
for(t in 1 : N) {
   bqt[n, k, t] <- inprod(pi[n, k, t, ], bq[]) / pow(1 + delta.b, t - 1)
}
BQ[n, k] <- sum(bqt[n, k, ])

# Markov model probabilities:
#######################

# Transition matrix
for(t in 2:N) {
Lambda[n, k, t, 1, 1] <- 1 - gamma[n, k, t] - lambda[k, t]
Lambda[n, k, t, 1, 2] <- gamma[n, k, t] * lambda.op
Lambda[n, k, t, 1, 3] <- gamma[n, k, t] *(1 - lambda.op)
Lambda[n, k, t, 1, 4] <- 0
Lambda[n, k, t, 1, 5] <- lambda[k, t]

Lambda[n, k, t, 2, 1] <- 0
Lambda[n, k, t, 2, 2] <- 0
Lambda[n, k, t, 2, 3] <- 0
Lambda[n, k, t, 2, 4] <- 0
Lambda[n, k ,t, 2, 5] <- 1

Lambda[n, k, t, 3, 1] <- 0
Lambda[n, k, t, 3, 2] <- 0
Lambda[n, k, t, 3, 3] <- 0
Lambda[n, k, t, 3, 4] <- 1 - lambda[k, t]
Lambda[n, k, t, 3, 5] <- lambda[k, t]

Lambda[n, k, t, 4, 1] <- 0
Lambda[n, k, t, 4, 2] <- rho * lambda.op
Lambda[n, k, t, 4, 3] <- rho * (1 - lambda.op)
Lambda[n, k, t, 4, 4] <- 1 - rho - lambda[k, t]
Lambda[n, k, t, 4, 5] <- lambda[k, t]

Lambda[n, k, t, 5, 1] <- 0
Lambda[n, k, t, 5, 2] <- 0
Lambda[n, k, t, 5, 3] <- 0
Lambda[n, k, t, 5, 4] <- 0
Lambda[n, k, t, 5, 5] <- 1

gamma[n, k, t] <- h[n, k] * (t - 1)
   }

# Marginal probability of being in each state at time 1
pi[n, k, 1, 1] <- 1 - lambda.op pi[n, k, 1, 2] <- 0 pi[n, k, 1, 3] <- 0
         pi[n, k, 1, 4] <- 0 pi[n, k, 1, 5] <- lambda.op

# Marginal probability of being in each state at time t>1
for(t in 2 : N) {
for(s in 1 : S) {
   pi[n, k,t, s] <- inprod(pi[n, k, t - 1, ], Lambda[n, k, t, , s])
}
}
}
}

# Incremental costs and benefits
##########################

for(k in 1 : K) {
C.incr[k] <- C[2, k] - C[1, k]
BQ.incr[k] <-BQ[2, k] - BQ[1, k]
ICER.strata[k] <- C.incr[k] / BQ.incr[k]
}

# Probability of cost effectiveness @ KK pounds per QALY
# (values of KK considered range from 200 to 20000 in 200 pound increments)
for(m in 1 : 100) {
for(k in 1 : 12) {
   P.CEA.strata[m,k] <- step(KK[m] * BQ.incr[k] - C.incr[k])
}
   P.CEA[m] <- step(KK[m] * mean.BQ.incr - mean.C.incr)
}

# overall incremental costs and benefit
for(n in 1 : 2) {
mean.C[n] <- inprod(p.strata[], C[n, ])
mean.BQ[n] <- inprod(p.strata[], BQ[n, ])
}
mean.C.incr <- mean.C[2] - mean.C[1]
mean.BQ.incr <- mean.BQ[2] - mean.BQ[1]
mean.ICER <- mean.C.incr / mean.BQ.incr }
Data
list(N = 60, # Number of cycles
K = 12, # Number of age-sex strata
S = 5, # Number of states in Markov model
M = 3, # Number of studies in evidence synthesis
rho = 0.04, # re-revision rate
lambda.op = 0.01, # post-operative mortality rate
# age-sex specific mean revision hazard for Charnley:
logh0 = c(-6.119, -6.119, -6.119, -6.438, -6.438, -6.438, -6.377, -6.377, -6.377, -6.725, -6.725, -6.725),
tau = 25,
C0 = c(4052, 4402), # set-up costs of primary operation
c = structure(.Data = c(0, 5290, 5290, 0, 0,
0, 5640, 5640, 0, 0), .Dim=c(2,5)), # additional costs associated with each state and prothesis
# (zero except for revision states 2 and 3)
bl = c(1,0,1,1,0), # life-expectancy benefits associated with each state (one except for death states 2 and 5)
bq = c(0.938, -0.622, -0.3387, 0.938, 0), # QALYs associated with each state
delta.c = 0.06, # cost discount
delta.b = 0.06, # health discount
# delta.b = 0.015, # alternative health discount (for sensitivity analysis)
# probablilty of hip replacement by age and sex
p.strata = c(0.02, 0.03, 0.07, 0.13, 0.10, 0.00, 0.02, 0.04, 0.10, 0.22, 0.26, 0.01),
lambda = structure(.Data = c(0.0017, 0.0017, 0.0017, 0.0017, 0.0017, 0.0044, 0.0044,
   0.0044, 0.0044, 0.0044, 0.0044, 0.0044, 0.0044, 0.0044, 0.0044, 0.0138,
   0.0138, 0.0138, 0.0138, 0.0138, 0.0138, 0.0138, 0.0138, 0.0138, 0.0138,
   0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379,
   0.0379, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912,
   0.0912, 0.0912, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.0044,
   0.0044, 0.0044, 0.0044, 0.0044, 0.0138, 0.0138, 0.0138, 0.0138, 0.0138,
   0.0138, 0.0138, 0.0138, 0.0138, 0.0138, 0.0379, 0.0379, 0.0379, 0.0379,
   0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0912, 0.0912, 0.0912,
   0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.0138, 0.0138, 0.0138, 0.0138,
   0.0138, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379,
   0.0379, 0.0379, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912,
   0.0912, 0.0912, 0.0912, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.0379, 0.0379, 0.0379, 0.0379, 0.0379, 0.0912, 0.0912,
   0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.0912, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.0912,
   0.0912, 0.0912, 0.0912, 0.0912, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958, 0.1958,
   0.1958, 0.1958, 0.0011, 0.0011, 0.0011, 0.0011, 0.0011, 0.0028, 0.0028,
   0.0028, 0.0028, 0.0028, 0.0028, 0.0028, 0.0028, 0.0028, 0.0028, 0.0081,
   0.0081, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081,
   0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022,
   0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578,
   0.0578, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.0028, 0.0028,
   0.0028, 0.0028, 0.0028, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081,
   0.0081, 0.0081, 0.0081, 0.0081, 0.022, 0.022, 0.022, 0.022, 0.022,
   0.022, 0.022, 0.022, 0.022, 0.022, 0.0578, 0.0578, 0.0578, 0.0578,
   0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.0081, 0.0081, 0.0081, 0.0081, 0.0081,
   0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022,
   0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578,
   0.0578, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.022, 0.022, 0.022, 0.022, 0.022, 0.0578, 0.0578, 0.0578, 0.0578,
   0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.0578, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.0578, 0.0578, 0.0578,
   0.0578, 0.0578, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503,
   0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503, 0.1503
   ), .Dim=c(12,60)),
   # Amount health care provider is willing to pay for each additional QALY
   KK = c(200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 3600, 3800, 4000,
4200, 4400, 4600, 4800, 5000, 5200, 5400, 5600, 5800, 6000, 6200, 6400, 6600, 6800, 7000, 7200, 7400, 7600, 7800, 8000,
8200, 8400, 8600, 8800, 9000, 9200, 9400, 9600, 9800, 10000, 10200, 10400, 10600, 10800, 11000,
11200, 11400, 11600, 11800, 12000, 12200, 12400, 12600, 12800, 13000, 13200, 13400, 13600, 13800, 14000,
14200, 14400, 14600, 14800, 15000, 15200, 15400, 15600, 15800, 16000, 16200, 16400, 16600, 16800, 17000,
17200, 17400, 17600, 17800, 18000, 18200, 18400, 18600, 18800, 19000, 19200, 19400, 19600, 19800, 20000),
# Evidence
rC = c(1683, 7, 33), # number of revisions for each study (Charnley)
nC = c(28525, 200, 208), # number of operations for each study (Charnley)
rS = c(28, 9, 69), # number of revisions for each study (Stanmore)
nS = c(865, 213, 982), # number of operations for each study (Stanmore)
# Quality weights for each study
qualweights = c(0.5, 1, 0.2)
# qualweights = c(0.1, 1, 0.05) # alternative quality weights for sensitivity analysis
)
Inits for chain 1
list(base=c(-3.09,-3.25,-2.12),logHR=c(-0.63,0.15,-0.92),LHR=-0.35)
   
Inits for chain 2
list(base=c(0,0,0),logHR=c(1,1,1),LHR=1)
Results

(quality weights c(0.5, 1, 0.2), delta.c = 0.06, delta.b = 0.06)


[hips41]