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: ggcoxfunctional works with coxph object not formulas #115
Comments
|
Thanks for the suggestion. |
|
The design of the library(survival)
fit <- coxph( Surv(futime, death) ~ mspike + log(mspike) + I(mspike^2) +
age + I(log(age)^2) + I(sqrt(age)), data = mgus)
library(survminer)
ggcoxfunctional(fit) |
|
Great! |
Would you consider a change in the design of ggcoxfunctional() function?
Right now it takes the formula and data, and is calling coxph function internally.
But it may be more flexible to separate the modelling and variable diagnostic.
The suggestion is to send an argument 'fit' instead of formula and data objects,
you can extract both formula and data from the 'fitobject'.
It will be also consistent with
ggcoxzph,ggcoxdiagnosticsandggsurvplotfunctions.