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

Suggestion: ggcoxfunctional works with coxph object not formulas #115

Closed
pbiecek opened this issue Jan 21, 2017 · 3 comments
Closed

Suggestion: ggcoxfunctional works with coxph object not formulas #115

pbiecek opened this issue Jan 21, 2017 · 3 comments

Comments

@pbiecek
Copy link
Contributor

@pbiecek pbiecek commented Jan 21, 2017

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, ggcoxdiagnostics and ggsurvplot functions.

@MarcinKosinski
Copy link
Contributor

@MarcinKosinski MarcinKosinski commented Jan 21, 2017

Thanks for the suggestion.
I did not realize this inconsistency.

kassambara added a commit that referenced this issue Jan 28, 2017
kassambara added a commit that referenced this issue Jan 28, 2017
@kassambara
Copy link
Owner

@kassambara kassambara commented Jan 28, 2017

The design of the ggcoxfunctional()is now consistent with the other functions.

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)
@pbiecek
Copy link
Contributor Author

@pbiecek pbiecek commented Jan 28, 2017

Great!

@pbiecek pbiecek closed this Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.