Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostic plots for cox model #16

Closed
MarcinKosinski opened this issue Feb 22, 2016 · 4 comments
Closed

Diagnostic plots for cox model #16

MarcinKosinski opened this issue Feb 22, 2016 · 4 comments

Comments

@MarcinKosinski
Copy link
Contributor

There was one great functionality of dx function http://www.inside-r.org/packages/cran/survMisc/docs/dxPlot that produced diagnostic plots for cox models. Do you think it would be valuable to add such functionality to survminer?

library(survMisc) # can be downloaded from CRAN from it's archives
data(bmt, package="KMsurv")
bmt <- within(bmt, {
   z1 <- z1 -28
   z2 <- z2- 28
   z3 <- z1*z2
   z4 <- as.double( group== 2 )
   z5 <- as.double( group== 3 )
   z6 <- z8
   z7 <- (z7 / 30) - 9
   z8 <- z10
})
c1 <- coxph(Surv(t2,d3) ~ z1+z2+z3+z4+z5+z6+z7+z8,
            method="breslow",
            data=bmt)
dx(c1, what="ph", file="vetDx.pdf")
@kassambara
Copy link
Owner

Yes of course!!

@MarcinKosinski
Copy link
Contributor Author

I have no motivation for rewriting dxPlot but I thought about new ggcoxdiagnostics/ggcoxdiagnostic function that would present

  1. deviance residuals VS linear predictions/combinations
  2. martingale residuals VS linear predictions/combinations
  3. deviance residuals VS observation index
  4. martingale residuals VS observation index

as this can be seen here on the page 4 (code is here). This article (sadly only in polish, it was an university project) presents basic survival analysis with plots for which we already have functions (ggsurvplot, ggcoxfunctional ggcoxzph) but we do not have plots for model diagnostics. The residuals shouldn't be larger that 2/3 and the shouldn't lay on a pattern line - they should be random.

I think this additional function would provide a nice toolkit for Cox Proportional Hazards Survival Analysis, and after that we could prepare a short article to R Journal using the template from rticles package
https://github.com/AnitaSzewczyk/SurvivalAnalysis/blob/master/projekt12015.pdf

@kassambara
Copy link
Owner

sorry, didn't see this comment yesterday:-)!
I think that this would be great!

@MarcinKosinski
Copy link
Contributor Author

Proposition in #44

kassambara pushed a commit that referenced this issue May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants