ex45.s<-function(){ tmpdf <- importData("../../sdata/resmye.ssd01") tmpdf0 <- importData("../../sdata/resmye0.ssd01") motif() par(mfrow=c(2,2)) attach(tmpdf0) title("BUN vs Martingale residual superimposed with lowess smoother",cex=0.6) plot(rscore, dev, xlab="Risk score", ylab="Deviance residual", xlim=c(-2, 2), ylim=c(-2, 3)) title("Deviance residuals plotted against the risk score", cex=0.6) plot(bun, mart, xlab="value of BUN", ylab="Martingale residual", xlim=c(3,175), ylim=c(-3,1)) lines(lowess(bun, mart), lty=1, lwd=2) detach() attach(tmpdf) plot(strank, mart, xlab="Rank of survival time", ylab="Martingale residual", xlim=c(0,50), ylim=c(-3,1)) plot(hb, mart, xlab="value of HB", ylab="Martingale residual", xlim=c(3,15), ylim=c(-3,1)) lines(lowess(hb, mart), lty=1, lwd=2) title("HB vs Martingale residual superimposed with lowess smoother",cex=0.6) motif() par(mfrow=c(2,2)) plot(lbun, mart, xlab="value of LBUN", ylab="Martingale residual", xlim=c(1,6), ylim=c(-3,1)) lines(lowess(lbun, mart), lty=1, lwd=2) title("LBUN vs Martingale residual superimposed with lowess smoother",cex=0.6) plot(strank, dev, xlab="Rank of survival time", ylab="Deviance residual", xlim=c(0,50), ylim=c(-2,2)) plot(hb, dev, xlab="value of HB", ylab="Deviance residual", xlim=c(3,15), ylim=c(-2,2)) plot(lbun, dev, xlab="value of LBUN", ylab="Deviance residual", xlim=c(1,6), ylim=c(-2,2)) motif() par(mfrow=c(2,2)) plot(survt, schhb, xlab="Survival time", ylab="Schoenfeld residual for HB", xlim=c(0,92), ylim=c(-6,6)) plot(strank, schhb, xlab="Rank of survival time", ylab="Schoenfeld residual for HB", xlim=c(0,50), ylim=c(-6,6)) plot(survt, schlbun, xlab="Survival time", ylab="Schoenfeld residual for LBUN", xlim=c(0,92), ylim=c(-2,2)) plot(strank, schlbun, xlab="Rank of survival time", ylab="Schoenfeld residual for LBUN", xlim=c(0,50), ylim=c(-2,2)) detach() }