## Not run:
#
# #############################################################
# # Time to Cosmetic Deterioration of Breast Cancer Patients
# #############################################################
#
# data(deterioration)
# attach(deterioration)
# ymat <- cbind(left,right)
#
# # design matrix for posterior predictive
# zpred <- rbind(c(1,0),c(1,1))
#
# # Prior information
#
# S0 <- diag(100,2)
# m0 <- rep(0,2)
# psiinv <- diag(1,2)
#
# prior <- list(a0=10,
# b0=1,
# nu=4,
# m0=m0,
# S0=S0,
# psiinv=psiinv,
# tau1=6.01,
# taus1=6.01,
# taus2=2.01)
#
# # Initial state
# state <- NULL
#
# # MCMC parameters
#
# nburn <- 5000
# nsave <- 5000
# nskip <- 3
# ndisplay <- 100
# mcmc <- list(nburn=nburn,
# nsave=nsave,
# nskip=nskip,
# ndisplay=ndisplay)
#
# # Fit the model
# fit1 <- LDDPsurvival(ymat~trt,prior=prior,
# mcmc=mcmc,state=state,status=TRUE,
# grid=seq(0.01,70,1),zpred=zpred)
#
#
# # Plot posterior density estimates
# # with design vector x0=(1,0)
#
# plot(fit1$grid,fit1$densp.h[1,],type="l",
# xlab="time",ylab="density",lty=2,lwd=2)
# lines(fit1$grid,fit1$densp.l[1,],lty=2,lwd=2)
# lines(fit1$grid,fit1$densp.m[1,],lty=1,lwd=3)
#
# # Plot posterior density estimates
# # with design vector x0=(1,1)
#
# plot(fit1$grid,fit1$densp.h[2,],type="l",
# xlab="time",ylab="density",lty=2,lwd=2)
# lines(fit1$grid,fit1$densp.l[2,],lty=2,lwd=2)
# lines(fit1$grid,fit1$densp.m[2,],lty=1,lwd=3)
#
# # Plot posterior survival estimates
# # with design vector x0=(1,0)
#
# plot(fit1$grid,fit1$survp.h[1,],type="l",
# xlab="time",ylab="survival",lty=2,lwd=2,ylim=c(0,1))
# lines(fit1$grid,fit1$survp.l[1,],lty=2,lwd=2)
# lines(fit1$grid,fit1$survp.m[1,],lty=1,lwd=3)
#
# # Plot posterior survival estimates
# # with design vector x0=(1,1)
#
# plot(fit1$grid,fit1$survp.h[2,],type="l",
# xlab="time",ylab="survival",lty=2,lwd=2,ylim=c(0,1))
# lines(fit1$grid,fit1$survp.l[2,],lty=2,lwd=2)
# lines(fit1$grid,fit1$survp.m[2,],lty=1,lwd=3)
#
# # Plot posterior hazard estimates
# # with design vector x0=(1,0)
#
# plot(fit1$grid,fit1$hazp.h[1,],type="l",
# xlab="time",ylab="hazard",lty=2,lwd=2)
# lines(fit1$grid,fit1$hazp.l[1,],lty=2,lwd=2)
# lines(fit1$grid,fit1$hazp.m[1,],lty=1,lwd=3)
#
# # Plot posterior hazard estimates
# # with design vector x0=(1,1)
#
# plot(fit1$grid,fit1$hazp.h[2,],type="l",
# xlab="time",ylab="survival",lty=2,lwd=2)
# lines(fit1$grid,fit1$hazp.l[2,],lty=2,lwd=2)
# lines(fit1$grid,fit1$hazp.m[2,],lty=1,lwd=3)
#
# ## End(Not run)
Run the code above in your browser using DataLab