rankhazardplot creates a rank-hazard plot of the covariates of a proportional hazards model.rankhazardplot(...)
## S3 method for class 'coxph':
rankhazardplot(coxphobj,refvalues=NULL,x=NULL,legendtext=NULL,axistext=NULL,plottype="hazard",...)
## S3 method for class 'cph':
rankhazardplot(cphobj,refvalues=NULL,x=NULL,legendtext=NULL,axistext=NULL,plottype="hazard",...)
## S3 method for class 'default':
rankhazardplot(x,coefs=NULL,xp=NULL,refvalues=NULL,legendtext=NULL,axistext=NULL,plottype="hazard",col=NULL,pch=NULL,lwd=1,...)NULL, the medians of each covariate are used.coxphobj$x or cphobj$x does not exist.NULL, the column names are from x, coxphobj$x or cphobj$x.NULL, the column names are from x, coxphobj$x or cphobj$x."hazard" for the relative hazard with log-scale or "loghazard" for the logarithm of the relative hazard with linear scale.NULL, xp is required.NULL, coefs is required and xp is calculated a product of coefs and x.par.points.par.coxph and cphlibrary(survival)
model <- coxph(Surv(time,status) ~ age + sex + ph.karno, data=cancer, x=TRUE)
rankhazardplot(model)Run the code above in your browser using DataLab