-
Notifications
You must be signed in to change notification settings - Fork 166
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
ggforest() doesn't show interactions HRs #496
Comments
I also encounter this issue; Hope the authors can address this issue in the future version. |
Dear Authors and Contributors, @kassambara , @MarcinKosinski, @zzawadz , @pbiecek Do you plan to fix this issue in the near future? I am sorry for asking, but I will need to consider switching to another package or write necessary procedure on my own and message my Professor about the need for additional work on that. Please, let me just know. |
Dear @Generalized Here is an example how to do this. You have:
What you can do is to create the variable that handles interaction manually:
and now you can fir an additive model and the ggforest will include it in the plot
Please note that here you have two numerical variables, this is why I've just multiplied them. |
Thank you. It's a perfect solution. Maybe, instead of "fixing" that automatically, especially if it requires some tricky coding, you could use this answer to make an example in a vignette? I think this may be rather a common issue, that people look for the interaction they explicitly specified yet which is missing in the output. Especially, that I saw a similar topic here on the list, but much earlier. This solution requires some extra work from the user, but gives the expected output, which is priceless, as we do not have switch to other packages to complete this task. Thank you! |
Good idea, |
New ggforest vignette added now |
How would one generalize this solution to interactions between categorical variables? |
This doesn't seem to work for an interaction between categorical variables. Is this a feature that might be added? Thanks! |
If you have categorical variables, you can concatenate them to make the combined, new categorical variables. Cat 1 Cat 2 Concat Then use the "Concat" column as your interaction variable. Hope this helps. |
Dear Authors,
I noticed, that the ggforest() function doesn't plot interactions. The version from CRAN doesn't do that, so I downloaded and installed the most fresh code from the GitHub via
devtools::install_github("kassambara/survminer", build_vignettes = FALSE)
. Same result.Expected behavior
An interaction should be shown
Actual behavior
Only the main effects are shown
Steps to reproduce the problem
Fit any Cox model with an interaction.
Run ggforest on it.
session_info()
The text was updated successfully, but these errors were encountered: