model {
thetaN <- 2 # expected lifetime without transplant
thetaT ~ dbeta(8,2) # probability of surviving operation
thetaP ~ dnorm(5,1) # expected survival post-transplant (mean 5, sd 1)
thetaC ~ dnorm(3000,0.000001)
# expected cost per year (mean 3000, sd 1000)
E.c <- (20000 + thetaC*thetaT*thetaP)/1000
# expected additional cost of transplant
# in thousands of pounds
E.e <- thetaT*thetaP - thetaN
# expected total additional survival
ICER <- E.c/E.e # incremental cost-effectiveness ratio
for (i in 1:21) {
K[i] <- (i-1)*5
INB[i] <- E.e*K[i] - E.c
Q[i] <- step(INB[i])
}
}

   node   mean   sd   MC error   2.5%   median   97.5%   start   sample
   E.c   31.98   5.097   0.01578   23.5   31.47   43.35   1   100000
   E.e   1.995   1.007   0.003094   0.09311   1.972   4.027   1   100000
   ICER   15.05   1113.0   3.702   7.189   15.98   84.68   1   100000
   INB[1]   -31.98   5.097   0.01578   -43.34   -31.47   -23.5   1   100000
   INB[2]   -22.0   4.586   0.01494   -29.82   -22.44   -11.89   1   100000
   INB[3]   -12.03   8.173   0.026   -26.35   -12.6   5.507   1   100000
   INB[4]   -2.056   12.78   0.04009   -25.42   -2.626   24.44   1   100000
   INB[5]   7.918   17.62   0.05493   -24.76   7.299   44.0   1   100000
   INB[6]   17.89   22.55   0.07004   -24.22   17.21   63.82   1   100000
   INB[7]   27.87   27.51   0.08527   -23.66   27.1   83.62   1   100000
   INB[8]   37.84   32.5   0.1006   -23.16   37.0   103.6   1   100000
   INB[9]   47.81   37.5   0.1159   -22.63   46.9   123.6   1   100000
   INB[10]   57.79   42.51   0.1313   -22.16   56.76   143.6   1   100000
   INB[11]   67.76   47.52   0.1467   -21.68   66.63   163.7   1   100000
   INB[12]   77.74   52.54   0.1621   -21.2   76.52   183.8   1   100000
   INB[13]   87.71   57.56   0.1775   -20.71   86.39   203.8   1   100000
   INB[14]   97.68   62.59   0.193   -20.26   96.24   224.1   1   100000
   INB[15]   107.7   67.61   0.2084   -19.82   106.1   244.3   1   100000
   INB[16]   117.6   72.64   0.2238   -19.29   116.0   264.4   1   100000
   INB[17]   127.6   77.67   0.2393   -18.85   125.9   284.4   1   100000
   INB[18]   137.6   82.69   0.2547   -18.35   135.8   304.4   1   100000
   INB[19]   147.6   87.72   0.2702   -17.97   145.6   324.6   1   100000
   INB[20]   157.5   92.75   0.2856   -17.49   155.5   344.6   1   100000
   INB[21]   167.5   97.78   0.3011   -17.01   165.3   364.7   1   100000
   Q[1]   0.0   0.0   3.162E-13   0.0   0.0   0.0   1   100000
   Q[2]   1.3E-4   0.0114   3.809E-5   0.0   0.0   0.0   1   100000
   Q[3]   0.07902   0.2698   8.593E-4   0.0   0.0   1.0   1   100000
   Q[4]   0.4203   0.4936   0.001531   0.0   0.0   1.0   1   100000
   Q[5]   0.6614   0.4732   0.001498   0.0   1.0   1.0   1   100000
   Q[6]   0.7799   0.4143   0.001334   0.0   1.0   1.0   1   100000
   Q[7]   0.8415   0.3652   0.00121   0.0   1.0   1.0   1   100000
   Q[8]   0.8777   0.3276   0.001022   0.0   1.0   1.0   1   100000
   Q[9]   0.9   0.3   9.632E-4   0.0   1.0   1.0   1   100000
   Q[10]   0.9157   0.2778   8.903E-4   0.0   1.0   1.0   1   100000
   Q[11]   0.9265   0.2609   8.315E-4   0.0   1.0   1.0   1   100000
   Q[12]   0.9339   0.2484   7.917E-4   0.0   1.0   1.0   1   100000
   Q[13]   0.9398   0.2378   7.583E-4   0.0   1.0   1.0   1   100000
   Q[14]   0.9447   0.2286   7.232E-4   0.0   1.0   1.0   1   100000
   Q[15]   0.9484   0.2212   7.011E-4   0.0   1.0   1.0   1   100000
   Q[16]   0.9514   0.215   6.871E-4   0.0   1.0   1.0   1   100000
   Q[17]   0.954   0.2095   6.867E-4   0.0   1.0   1.0   1   100000
   Q[18]   0.9562   0.2047   6.907E-4   0.0   1.0   1.0   1   100000
   Q[19]   0.958   0.2006   6.698E-4   0.0   1.0   1.0   1   100000
   Q[20]   0.9595   0.1971   6.466E-4   0.0   1.0   1.0   1   100000
   Q[21]   0.9607   0.1942   6.383E-4   0.0   1.0   1.0   1   100000

[example-2_7_2-heart-transplant-continued0][example-2_7_2-heart-transplant-continued1][example-2_7_2-heart-transplant-continued2][example-2_7_2-heart-transplant-continued3]