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

Modifications in Cox model visualization #410

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

DanChaltiel
Copy link
Contributor

Hi Alboukadel,

First, thank you for this great package, your code is incredible!

Here is a little pull request on 2 functions.

ggcoxfunctional.R

On ggcoxfunctional.R, I only made a minor modification which correct an error I get a lot.

Indeed, if a model includes categorical variables, the function will throw :

Error in xy.coords(x, y, setLab = FALSE) : 'x' and 'y' lengths differ

Since every variable is plotted against the null model, I thought it makes sence to just exclude categorical variables.

ggcoxzph.R

On ggcoxzph.R, modifications are quite substantial and maybe subject to discussion.

Your function plots an estimation of beta as a function of time. In order to validate the proportionnal hazard assumption, I find very valuable to plot the beta estimated by the model on top of your graph.

In order to access this coefficient, I need the fit object to be of class coxph so I added support to this class. Then I just had to add a geom_hline call plus some arguments and documentation.

I didn't see any testthat in your package to comply with, but I think I tested these functions pretty thoroughly.

Hope it can help :-)
Dan

@DanChaltiel
Copy link
Contributor Author

Sorry, I'm not familliar with travis-ci, and its documentation is not really helping.

How can I know where the error is?

When there was missing values, explanatory.variables.values and data were not the dame size
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

Successfully merging this pull request may close these issues.

1 participant