#Bayesian MAP analysis with piecewise constant baseline hazard model { ## Likelihoods ## for (i in 1:N) { # define the likelihood mu[i] <- TimeIntervals[i]*exp(alpha[Interval[i]]+inprod(par[],X[i,])+theta[Trial[i]]) EventsIntervals[i] ~ dpois(mu[i]); } precision_heterogeneity<-1/(std_heterogeneity*std_heterogeneity) #Half-normal prior for std of study effects sigma_heterogeneity ~ dnorm(10^-20,precision_heterogeneity) #Precision of study effects tau <- 1/(sigma_heterogeneity*sigma_heterogeneity) #Theta's (trial specific effects) are normally distributed. Here we set the population mean of the theta's to zero, #because the alpha's already describe the baseline hazard. for (i in minTrial:maxTrial){ theta[i] ~ dnorm(0, tau) } #Correlated Priors on Log-Hazards for (j in 1:P){ par[j] ~ dnorm(0,0.0001); } alpha[1] ~ dnorm(0,0.0001); for (k in 2:K) { alpha[k] ~ dnorm(alpha[k-1], eta); } eta <- 1/(sigma*sigma); sigma ~ dunif(0.01,100); }