Modifications in Cox model visualization #410
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 :
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 classcoxph
so I added support to this class. Then I just had to add ageom_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