Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSuggestion: a new function ggcoxadjustedcurves to fix #67 #133
Comments
|
R CMD check: checking R code for possible problems ... NOTE |
|
In the survminer functions eval(fit$call$data) is commonly used to get the model data. This lead to repetitive issues, for example #125 & #9. It might be better, if we add an extra argument, say If yes, then we should update if(missing(data)){
warning ("...warning message...")
data <- eval(fit$call$data)
}What do you think @pbiecek , @MarcinKosinski ? |
|
An error is generated with the R code below: library(survival)
library(survminer)
fit <- coxph(Surv(time, status) ~ age + ph.ecog+sex, data = lung)
ggcoxadjustedcurves(fit)
But, this works: fit <- coxph(Surv(time, status) ~ age + sex, data = lung)
ggcoxadjustedcurves(fit) |
|
Regarding the But I agree, that the best way is to add additional |
…r ggcoxadjusted curves
|
Regarding NOTEs in CHECK, |
…even in some data is missing
* 'master' of https://github.com/pbiecek/survminer: revert fix for kassambara#133, now the average survival curve is calculated even in some data is missing
…al with conflicts with NULL assignments in ggcoxadjustedcurves
|
The problem with |
|
oh, great!!! |
|
Good job with that function and with missing Can we stick to one naming conventions for parameters? Instead of |
|
@pbiecek can you also consider updating this file https://github.com/kassambara/survminer/blob/master/_pkgdown.yml with every new functionality? This is the configuration for the package site http://www.sthda.com/english/rpkgs/survminer/ |
|
@MarcinKosinski updated var names are in 7f5d590 |
|
regarding the convention for names |
fix for #133, sorry for the mess with reverts
In #67 @markdanese proposed to add survival curves for cox model.
Not curves for average values of variables but curves averages over the distribution of variables observed in the data (like here: https://cran.r-project.org/web/packages/survival/vignettes/adjcurve.pdf, or in Marks' code here: https://gist.github.com/markdanese/d1ddfdb2f618373c719bdb444ca34be9)
Suggestion: add a ggcoxadjustedcurves() function, that will plot survival curve for the whole dataset (average over all individual curves) or for subsets generated by a given variable.
In addition, al individual curves may be also added to the plot.
Some examples:
For whole dataset
For selected variables
btw: I am not familiar with data.table, so this function uses dplyr and tidyr