#This S-Plus program will produce Figure 6 which contains the relative hazards of period 2, 3, and 4 to period 1 for the #best fitting two-parameter distribution in the GG family; 90% confidence bands are also shown. #Boxplots of relative hazards for t=1,2, and 3 based on 500 bootstrap samples for period2,3,4 to 1 are also shown #3 data files (P2 vs. P1, P3 vs. P1, P4 vs. P1) with five variables: period, time, relative hazard, lower limit of confidence band, upper limit of confidence band p2p1_matrix(scan("C:/mikefolder/mikeFolder/survivalmethods/programsforweb/Figures_revisedpaper/RelHzd2vs1FIG6.dat"),ncol=5,byrow=T) p3p1_matrix(scan("C:/mikefolder/mikeFolder/survivalmethods/programsforweb/Figures_revisedpaper/RelHzd3vs1FIG6.dat"),ncol=5,byrow=T) p4p1_matrix(scan("C:/mikefolder/mikeFolder/survivalmethods/programsforweb/Figures_revisedpaper/RelHzd4vs1FIG6.dat"),ncol=5,byrow=T) #Change path below for postscript file location postscript("C:/mikefolder/mikeFolder/survivalmethods/programsforweb/Figures_revisedpaper/GGfig6.ps", horizontal=T) period_p2p1[,1] timep2p1_ p2p1[,2] #relative hazards for period 2 to period 1 along with lower and upper limits of 90% confidence bands for different values of t hazardp2p1_p2p1[,3] hazardp2p1lb_p2p1[,4] hazardp2p1ub_p2p1[,5] period_p3p1[,1] timep3p1_p3p1[,2] #relative hazards for period 3 to period 1 along with lower and upper limits of 90% confidence bands for different values of t hazardp3p1_p3p1[,3] hazardp3p1lb_p3p1[,4] hazardp3p1ub_p3p1[,5] period_p4p1[,1] timep4p1_p4p1[,2] #relative hazards for period 4 to period 1 along with lower and upper limits of 90% confidence bands for different values of t hazardp4p1_p4p1[,3] hazardp4p1lb_p4p1[,4] hazardp4p1ub_p4p1[,5] par(mfrow=c(1,3)) par(mgp=c(1.8, 1.2, 0), mar=c(8, 5, 4, 1)) ############################################################################################################### ############################################################################################################### ######################################### P2 versus P1 ######################################################## ############################################################################################################### ############################################################################################################### #Gamma Period 2 and Ammag in Period 1 #three boxplots representing the bootstrap distribution of relative hazards at t=1, 2, and 3 respectively #t=1 x95to75gg10 <- c(0.98, 0.98) y95to75gg10 <- c(1.0325, 0.9610) x75gg10 <- c(0.55, 1.45) y75gg10 <- c(0.9610, 0.9610) xleftgg10 <- c(0.55, 0.55) yleftgg10 <- c(0.9610,0.8749) x25gg10 <- c(0.55, 1.45) y25gg10 <- c(0.8749, 0.8749) xrightgg10 <- c(1.45, 1.45) yrightgg10 <- c(0.9610, 0.8749) x25to5gg10 <- c(0.98, 0.98) y25to5gg10 <- c(0.8749, 0.8147) x50gg10 <- c(0.55, 1.45) y50gg10 <- c(0.9121,0.9121) plot(x95to75gg10,y95to75gg10,xlim=c(.5,3.5),ylim=c(0,1.2),xlab="",ylab="",axes=F,type="n") axis(2,at=seq(0,1.2,0.2),label=c("0.0","0.2","0.4","0.6","0.8","1.0","1.2"),cex=0.80,tck=-0.01) axis(1,at=seq(1,3,1),label=c("1", "2", "3"),cex=0.8) abline(h=1,lty=2) title(main="\n Period 2 to Period 1", cex=0.8) title(ylab="Relative Hazard", cex=1.1) lines(x95to75gg10,y95to75gg10, lty=1, lwd=1.5) lines(x75gg10, y75gg10, lty=1, lwd=1.5) lines(xleftgg10, yleftgg10, lty=1, lwd=1.5) lines(x25gg10, y25gg10, lty=1, lwd=1.5) lines(xrightgg10, yrightgg10, lty=1, lwd=1.5) lines(x25to5gg10, y25to5gg10, lty=1, lwd=1.5) lines(x50gg10, y50gg10, lty=1, lwd=1.5) #t=2 x95to75gg20 <- c(1.98, 1.98) y95to75gg20 <- c(1.0221, 0.9103) x75gg20 <- c(1.55, 2.45) y75gg20 <- c(0.9103,0.9103) xleftgg20 <- c(1.55, 1.55) yleftgg20 <- c(0.9103, 0.7954) x25gg20 <- c(1.55, 2.45) y25gg20 <- c(0.7954, 0.7954) xrightgg20 <- c(2.45, 2.45) yrightgg20 <- c(0.9103, 0.7954) x25to5gg20 <- c(1.98, 1.98) y25to5gg20 <- c(0.7954, 0.7144) x50gg20 <- c(1.55, 2.45) y50gg20 <- c(0.8504,0.8504) lines(x95to75gg20,y95to75gg20, lty=1, lwd=1.5) lines(x75gg20, y75gg20, lty=1, lwd=1.5) lines(xleftgg20, yleftgg20, lty=1, lwd=1.5) lines(x25gg20, y25gg20, lty=1, lwd=1.5) lines(xrightgg20, yrightgg20, lty=1, lwd=1.5) lines(x25to5gg20, y25to5gg20, lty=1, lwd=1.5) lines(x50gg20, y50gg20, lty=1, lwd=1.5) #t=3 x95to75gg30 <- c(2.98, 2.98) y95to75gg30 <- c(1.0092, 0.8541) x75gg30 <- c(2.55, 3.45) y75gg30 <- c(0.8541, 0.8541) xleftgg30 <- c(2.55, 2.55) yleftgg30 <- c(0.8541, 0.7021) x25gg30 <- c(2.55, 3.45) y25gg30 <- c(0.7021, 0.7021) xrightgg30 <- c(3.45, 3.45) yrightgg30 <- c(0.8541, 0.7021) x25to5gg30 <- c(2.98, 2.98) y25to5gg30 <- c(0.7021, 0.5915) x50gg30 <- c(2.55, 3.45) y50gg30 <- c(0.7750,0.7750) lines(x95to75gg30,y95to75gg30, lty=1, lwd=1.5) lines(x75gg30, y75gg30, lty=1, lwd=1.5) lines(xleftgg30, yleftgg30, lty=1, lwd=1.5) lines(x25gg30, y25gg30, lty=1, lwd=1.5) lines(xrightgg30, yrightgg30, lty=1, lwd=1.5) lines(x25to5gg30, y25to5gg30, lty=1, lwd=1.5) lines(x50gg30, y50gg30, lty=1, lwd=1.5) lines(timep2p1[(timep2p1 >= 0.50) & (timep2p1 <= 3.5)],hazardp2p1[(timep2p1 >= 0.50) & (timep2p1 <= 3.5)],lty=1,lwd=1.5) lines(timep2p1[(timep2p1 >= 0.50) & (timep2p1 <= 3.5)],hazardp2p1lb[(timep2p1 >= 0.50) & (timep2p1 <= 3.5)],lty=1,lwd=1.5) lines(timep2p1[(timep2p1 >= 0.50) & (timep2p1 <= 3.5)],hazardp2p1ub[(timep2p1 >= 0.50) & (timep2p1 <= 3.5)],lty=1,lwd=1.5) box() ############################################################################################################## ############################################################################################################## ######################################### P3 versus P1 ####################################################### ############################################################################################################## ############################################################################################################## #Ammag Period 3 and Ammag Period 1 #three boxplots representing the bootstrap distribution of relative hazards at t=1, 2, and 3 respectively #t=1 x95to75gg10 <- c( 0.98, 0.98) y95to75gg10 <- c(0.2630, 0.2398) x75gg10 <- c(0.55, 1.45) y75gg10 <- c(0.2398, 0.2398) xleftgg10 <- c(0.55, 0.55) yleftgg10 <- c(0.2398, 0.2063) x25gg10 <- c(0.55, 1.45) y25gg10 <- c(0.2063, 0.2063) xrightgg10 <- c(1.45, 1.45) yrightgg10 <- c(0.2398, 0.2063) x25to5gg10 <- c(0.98, 0.98) y25to5gg10 <- c(0.2063, 0.1883) x50gg10 <- c(0.55, 1.45) y50gg10 <- c(0.2218, 0.2218) plot(x95to75gg10,y95to75gg10,xlim=c(.5,3.5),ylim=c(0,1.2),xlab="",ylab="",axes=F,type="n") axis(2,at=seq(0,1.2,0.2),label=c("0.0","0.2","0.4","0.6","0.8","1.0","1.2"),cex=0.80,tck=-0.01) axis(1,at=seq(1,3,1),label=c("1", "2", "3"),cex=0.8) title(main="\n Period 3 to Period 1", cex=0.8) key(0.5, -0.14, text="Years since AIDS Diagonosis", cex=1.0, adj=0) key(-0.9, -0.21, text="(Hazards at 1, 2, 3 years for Period 1: 0.59, 0.71, 0.82)", cex=1.0, adj=0) abline(h=1,lty=2) lines(x95to75gg10,y95to75gg10, lty=1, lwd=1.5) lines(x75gg10, y75gg10, lty=1, lwd=1.5) lines(xleftgg10, yleftgg10, lty=1, lwd=1.5) lines(x25gg10, y25gg10, lty=1, lwd=1.5) lines(xrightgg10, yrightgg10, lty=1, lwd=1.5) lines(x25to5gg10, y25to5gg10, lty=1, lwd=1.5) lines(x50gg10, y50gg10, lty=1, lwd=1.5) #t=2 x95to75gg20 <- c(1.98, 1.98) y95to75gg20 <- c(0.1725, 0.1506) x75gg20 <- c(1.55, 2.45) y75gg20 <- c(0.1506, 0.1506) xleftgg20 <- c(1.55, 1.55) yleftgg20 <- c(0.1506, 0.1203) x25gg20 <- c(1.55, 2.45) y25gg20 <- c(0.1203, 0.1203) xrightgg20 <- c(2.45, 2.45) yrightgg20 <- c(0.1506, 0.1203) x25to5gg20 <- c(1.98, 1.98) y25to5gg20 <- c(0.1203, 0.1014) x50gg20 <- c(1.55, 2.45) y50gg20 <- c(0.1336, 0.1336) lines(x95to75gg20,y95to75gg20, lty=1, lwd=1.5) lines(x75gg20, y75gg20, lty=1, lwd=1.5) lines(xleftgg20, yleftgg20, lty=1, lwd=1.5) lines(x25gg20, y25gg20, lty=1, lwd=1.5) lines(xrightgg20, yrightgg20, lty=1, lwd=1.5) lines(x25to5gg20, y25to5gg20, lty=1, lwd=1.5) lines(x50gg20, y50gg20, lty=1, lwd=1.5) #t=3 x95to75gg30 <- c(2.98, 2.98) y95to75gg30 <- c(0.1355, 0.1108) x75gg30 <- c(2.55, 3.45) y75gg30 <- c(0.1108, 0.1108) xleftgg30 <- c(2.55, 2.55) yleftgg30 <- c(0.1108, 0.0825) x25gg30 <- c(2.55, 3.45) y25gg30 <- c(0.0825, 0.0825) xrightgg30 <- c(3.45, 3.45) yrightgg30 <- c(0.1108, 0.0825) x25to5gg30 <- c(2.98, 2.98) y25to5gg30 <- c(0.0825, 0.0662) x50gg30 <- c(2.55, 3.45) y50gg30 <- c(0.0948, 0.0948) lines(x95to75gg30,y95to75gg30, lty=1, lwd=1.5) lines(x75gg30, y75gg30, lty=1, lwd=1.5) lines(xleftgg30, yleftgg30, lty=1, lwd=1.5) lines(x25gg30, y25gg30, lty=1, lwd=1.5) lines(xrightgg30, yrightgg30, lty=1, lwd=1.5) lines(x25to5gg30, y25to5gg30, lty=1, lwd=1.5) lines(x50gg30, y50gg30, lty=1, lwd=1.5) lines(timep3p1[(timep3p1 >= 0.50) & (timep3p1 <= 3.5)],hazardp3p1[(timep3p1 >= 0.50) & (timep3p1 <= 3.5)],lty=1,lwd=1.5) lines(timep3p1[(timep3p1 >= 0.50) & (timep3p1 <= 3.5)],hazardp3p1lb[(timep3p1 >= 0.50) & (timep3p1 <= 3.5)],lty=1,lwd=1.5) lines(timep3p1[(timep3p1 >= 0.50) & (timep3p1 <= 3.5)],hazardp3p1ub[(timep3p1 >= 0.50) & (timep3p1 <= 3.5)],lty=1,lwd=1.5) box() ############################################################################################################## ############################################################################################################## ######################################### P4 versus P1 ####################################################### ############################################################################################################## ############################################################################################################## #Weibull Period 4 and Ammag Period 1 #three boxplots representing the bootstrap distribution of relative hazards at t=1, 2, and 3 respectively #t=1 x95to75gg10 <- c( 0.98, 0.98) y95to75gg10 <- c(0.1578, 0.1326) x75gg10 <- c(0.55, 1.45) y75gg10 <- c(0.1326, 0.1326) xleftgg10 <- c(0.55, 0.55) yleftgg10 <- c(0.1326, 0.1009) x25gg10 <- c(0.55, 1.45) y25gg10 <- c(0.1009, 0.1009) xrightgg10 <- c(1.45, 1.45) yrightgg10 <- c(0.1326, 0.1009) x25to5gg10 <- c(0.98, 0.98) y25to5gg10 <- c(0.1009, 0.0795) x50gg10 <- c(0.55, 1.45) y50gg10 <- c(0.1192, 0.1192) plot(x95to75gg10,y95to75gg10,xlim=c(0.5,3.5),ylim=c(0,1.2),xlab="",ylab="",axes=F,type="n") axis(2,at=seq(0,1.2,0.2),label=c("0.0","0.2","0.4","0.6","0.8","1.0","1.2"),cex=0.80,tck=-0.01) axis(1,at=seq(1,3,1),label=c("1", "2", "3"),cex=0.8) abline(h=1,lty=2) title(main="\n Period 4 to Period 1", cex=0.8) lines(x95to75gg10,y95to75gg10, lty=1, lwd=1.5) lines(x75gg10, y75gg10, lty=1, lwd=1.5) lines(xleftgg10, yleftgg10, lty=1, lwd=1.5) lines(x25gg10, y25gg10, lty=1, lwd=1.5) lines(xrightgg10, yrightgg10, lty=1, lwd=1.5) lines(x25to5gg10, y25to5gg10, lty=1, lwd=1.5) lines(x50gg10, y50gg10, lty=1, lwd=1.5) #t=2 x95to75gg20 <- c(1.98, 1.98) y95to75gg20 <- c(0.1037, 0.0910) x75gg20 <- c(1.55, 2.45) y75gg20 <- c(0.0910, 0.0910) xleftgg20 <- c(1.55, 1.55) yleftgg20 <- c(0.0910, 0.0750) x25gg20 <- c(1.55, 2.45) y25gg20 <- c(0.0750, 0.0750) xrightgg20 <- c(2.45, 2.45) yrightgg20 <- c(0.0910, 0.0750) x25to5gg20 <- c(1.98, 1.98) y25to5gg20 <- c(0.0750, 0.0646) x50gg20 <- c(1.55, 2.45) y50gg20 <- c(0.0845,0.0845) lines(x95to75gg20,y95to75gg20, lty=1, lwd=1.5) lines(x75gg20, y75gg20, lty=1, lwd=1.5) lines(xleftgg20, yleftgg20, lty=1, lwd=1.5) lines(x25gg20, y25gg20, lty=1, lwd=1.5) lines(xrightgg20, yrightgg20, lty=1, lwd=1.5) lines(x25to5gg20, y25to5gg20, lty=1, lwd=1.5) lines(x50gg20, y50gg20, lty=1, lwd=1.5) #t=3 x95to75gg30 <- c(2.98, 2.98) y95to75gg30 <- c(0.0859, 0.0739) x75gg30 <- c(2.55, 3.45) y75gg30 <- c(0.0739, 0.0739) xleftgg30 <- c(2.55, 2.55) yleftgg30 <- c(0.0739, 0.0585) x25gg30 <- c(2.55, 3.45) y25gg30 <- c(0.0585, 0.0585) xrightgg30 <- c(3.45, 3.45) yrightgg30 <- c(0.0739, 0.0585) x25to5gg30 <- c(2.98, 2.98) y25to5gg30 <- c(0.0585, 0.0485) x50gg30 <- c(2.55, 3.45) y50gg30 <- c(0.0668, 0.0668) lines(x95to75gg30,y95to75gg30, lty=1, lwd=1.5) lines(x75gg30, y75gg30, lty=1, lwd=1.5) lines(xleftgg30, yleftgg30, lty=1, lwd=1.5) lines(x25gg30, y25gg30, lty=1, lwd=1.5) lines(xrightgg30, yrightgg30, lty=1, lwd=1.5) lines(x25to5gg30, y25to5gg30, lty=1, lwd=1.5) lines(x50gg30, y50gg30, lty=1, lwd=1.5) lines(timep4p1[(timep4p1 >= 0.50) & (timep4p1 <= 3.5)],hazardp4p1[(timep4p1 >= 0.50) & (timep4p1 <= 3.5)],lty=1,lwd=1.5) lines(timep4p1[(timep4p1 >= 0.50) & (timep4p1 <= 3.5)],hazardp4p1lb[(timep4p1 >= 0.50) & (timep4p1 <= 3.5)],lty=1,lwd=1.5) lines(timep4p1[(timep4p1 >= 0.50) & (timep4p1 <= 3.5)],hazardp4p1ub[(timep4p1 >= 0.50) & (timep4p1 <= 3.5)],lty=1,lwd=1.5) box() dev.off()