Chapter 11 Exercises
Leukaemia: semiparametric survival models
Solutions

For the leukaemia data in Example 11.7.2, compare the piecewise constant hazard models to a simple exponential survival model with a constant hazard. Is there any benefit in the piecewise constant models?


model{
for (i in 1:N) {
for (j in 1:T) {
Y[i,j] <- step(obs.t[i] - t[j] + eps)
dN[i,j] <- Y[i,j]*step(t[j+1] - obs.t[i] - eps)*ind[i]
}
}
dt[1] <- t[1]
for (j in 2:(T+1)) {
dt[j] <- t[j] - t[j-1]
}
for (j in 1:T) {
for (i in 1:N) {
dN[i,j] ~ dpois(Idt[i,j])
Idt[i,j] <- Y[i,j] * exp(beta*Z[i]) * lam * dt[j]
}
}
cumhaz.treat[1] <- 0
cumhaz.placebo[1] <- 0
for (j in 2:(T+1)) {
cumhaz.treat[j] <- cumhaz.treat[j-1] + lam * dt[j]*exp(beta*-0.5)
cumhaz.placebo[j] <- cumhaz.placebo[j-1] + lam * dt[j]*exp(beta*0.5)
S.treat[j] <- exp(-cumhaz.treat[j])
S.placebo[j] <- exp(-cumhaz.placebo[j])
}
lam ~ dgamma(0.001, 0.001)
beta ~ dnorm(0.0, 0.000001)
dummy <- period4[1]
}

list(N=42, T=23, eps=1.0E-10,
obs.t=c(1,1,2,2,3,4,4,5,5,8,8,8,8,11,11,12,12,15,17,22,23,
6,6,6,6,7,9,10,10,11,13,16,17,19,20,22,23,25,32,32,34,35),
ind=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0),
Z=c(0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,
0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,
-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,
-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5),
t=c(1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,19,20,22,23,25,32,34,35),
period4=c(1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4))

list( beta = 0.0, lam = 0.1 )


   node   mean   sd   MC error   2.5%   median   97.5%   start   sample
   S.placebo[2]   0.8912   0.02237   1.998E-4   0.8437   0.8923   0.9315   100   5901
   S.placebo[3]   0.7948   0.03972   3.552E-4   0.7118   0.7963   0.8676   100   5901
   S.placebo[4]   0.7093   0.05295   4.742E-4   0.6005   0.7106   0.8081   100   5901
   S.placebo[5]   0.6333   0.0628   5.635E-4   0.5067   0.6341   0.7527   100   5901
   S.placebo[6]   0.5659   0.06989   6.287E-4   0.4275   0.5658   0.7011   100   5901
   S.placebo[7]   0.5059   0.07474   6.744E-4   0.3606   0.5049   0.6531   100   5901
   S.placebo[8]   0.4525   0.07777   7.041E-4   0.3043   0.4505   0.6083   100   5901
   S.placebo[9]   0.405   0.07935   7.212E-4   0.2567   0.402   0.5666   100   5901
   S.placebo[10]   0.3628   0.07976   7.281E-4   0.2166   0.3588   0.5278   100   5901
   S.placebo[11]   0.3251   0.07925   7.268E-4   0.1827   0.3201   0.4916   100   5901
   S.placebo[12]   0.2915   0.07802   7.193E-4   0.1542   0.2857   0.4579   100   5901
   S.placebo[13]   0.2615   0.07624   7.067E-4   0.1301   0.2549   0.4265   100   5901
   S.placebo[14]   0.2108   0.07155   6.712E-4   0.09258   0.203   0.3701   100   5901
   S.placebo[15]   0.1895   0.06883   6.499E-4   0.07811   0.1811   0.3447   100   5901
   S.placebo[16]   0.1704   0.06598   6.272E-4   0.0659   0.1616   0.3211   100   5901
   S.placebo[17]   0.138   0.06008   5.793E-4   0.04691   0.1287   0.2786   100   5901
   S.placebo[18]   0.1242   0.05712   5.549E-4   0.03957   0.1148   0.2595   100   5901
   S.placebo[19]   0.1009   0.05134   5.064E-4   0.02817   0.09145   0.2251   100   5901
   S.placebo[20]   0.09105   0.04855   4.827E-4   0.02376   0.0816   0.2097   100   5901
   S.placebo[21]   0.07419   0.04326   4.37E-4   0.01692   0.06498   0.1819   100   5901
   S.placebo[22]   0.03682   0.02812   3.007E-4   0.005147   0.02928   0.1107   100   5901
   S.placebo[23]   0.03027   0.02475   2.689E-4   0.003664   0.02331   0.09601   100   5901
   S.placebo[24]   0.02746   0.02321   2.542E-4   0.003091   0.0208   0.08943   100   5901
   S.treat[2]   0.975   0.008222   1.184E-4   0.9562   0.976   0.9886   100   5901
   S.treat[3]   0.9508   0.01599   2.305E-4   0.9143   0.9526   0.9773   100   5901
   S.treat[4]   0.9272   0.02333   3.366E-4   0.8742   0.9297   0.9662   100   5901
   S.treat[5]   0.9042   0.03026   4.37E-4   0.8359   0.9074   0.9552   100   5901
   S.treat[6]   0.8819   0.0368   5.32E-4   0.7993   0.8856   0.9443   100   5901
   S.treat[7]   0.8602   0.04297   6.218E-4   0.7643   0.8644   0.9335   100   5901
   S.treat[8]   0.8391   0.04878   7.065E-4   0.7308   0.8437   0.9228   100   5901
   S.treat[9]   0.8185   0.05426   7.866E-4   0.6988   0.8234   0.9123   100   5901
   S.treat[10]   0.7985   0.05941   8.62E-4   0.6682   0.8037   0.9019   100   5901
   S.treat[11]   0.7791   0.06425   9.332E-4   0.6389   0.7844   0.8916   100   5901
   S.treat[12]   0.7602   0.0688   0.001   0.6109   0.7655   0.8815   100   5901
   S.treat[13]   0.7417   0.07308   0.001063   0.5841   0.7472   0.8714   100   5901
   S.treat[14]   0.7064   0.08083   0.001178   0.5341   0.7118   0.8516   100   5901
   S.treat[15]   0.6894   0.08435   0.00123   0.5107   0.6947   0.8419   100   5901
   S.treat[16]   0.6729   0.08763   0.001279   0.4883   0.678   0.8323   100   5901
   S.treat[17]   0.6412   0.09354   0.001368   0.4465   0.6459   0.8134   100   5901
   S.treat[18]   0.6259   0.0962   0.001408   0.4269   0.6304   0.8042   100   5901
   S.treat[19]   0.5966   0.1009   0.00148   0.3903   0.6005   0.7859   100   5901
   S.treat[20]   0.5826   0.1031   0.001512   0.3732   0.5861   0.777   100   5901
   S.treat[21]   0.5555   0.1068   0.001569   0.3412   0.5583   0.7593   100   5901
   S.treat[22]   0.4713   0.1156   0.001707   0.2494   0.471   0.7007   100   5901
   S.treat[23]   0.4499   0.1171   0.001732   0.228   0.4487   0.6848   100   5901
   S.treat[24]   0.4396   0.1177   0.001742   0.218   0.4379   0.677   100   5901
   beta   1.55   0.4107   0.005211   0.791   1.542   2.391   100   5901
   lam   0.05299   0.01065   1.478E-4   0.03431   0.05226   0.07563   100   5901
   
   Dbar   Dhat   pD   DIC   
dN   214.881   212.856   2.025   216.905   
total   214.881   212.856   2.025   216.905


Judging from a DIC of around 217, compared to 221 for the piecewise constant model, there does not seem to be a significant improvement in fit from allowing the hazard to vary over time in this way. Note that even under the model with four hazard pieces, the posterior distributions of the four different hazards lam[1],...,lam[4] are very similar, except perhaps that there are higher hazards in the last of the four periods. Since this dataset is small, it is not surprising that there is insufficient power to identify a much more complex model.