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

Plotting categorical variables without reference #11

Closed
jgarces02 opened this issue Jun 21, 2018 · 6 comments
Closed

Plotting categorical variables without reference #11

jgarces02 opened this issue Jun 21, 2018 · 6 comments

Comments

@jgarces02
Copy link

Hi @NikNakk, I like so much your package, it's very easy to use.

I'm doing a survival analysis with categorical variables (I've categorized a numeric value of a gene to different expression levels) and, when I draw the forest_model plot, the first group is used as reference... could you explain why (I though that was a simple ratio) and is there any way to avoid this and take it as another normal variable?

image

Thanks a lot in advance!

@NikNakk
Copy link
Owner

NikNakk commented Jun 21, 2018 via email

@jgarces02
Copy link
Author

Hi @NikNakk, you're right... I didn't think that reference came from previous cox regression not from (obviously) the figure. Thanks anyway for your help!

@NikNakk NikNakk closed this as completed Feb 25, 2019
@fittken
Copy link

fittken commented Apr 3, 2020

Hi guys,

  1. I have the same problem. Can anyone tell me how to get the hazard ratios for categorical variables without a reference? There are forest plots without a reference, how do I get these hazard ratios?

  2. How do I handle categorical variables with more than 2 levels? How can I get the hazard ratios?

Thank you for helping me!

@jgarces02
Copy link
Author

Hi @fittken,

  1. You cannot calculate a hazard ratio without a reference because this is always a relative (to something) risk.
  2. Hazard ratio can be obtained from a Cox regression, and it's indifferent use a two- or more-levels category.

Maybe these tutorials give you some ideas -> [1] and [2]

@fittken
Copy link

fittken commented Apr 4, 2020

Hi @jgarces02 ,
thank you for your fast answer!

Sorry, I think my question was not specific enough.

I want to create a forest plot in order to show a subgroup analysis, like this one

For example the subgroup age >65 years and the subgroup <65 years, they both have a hazard ratio displayed.

  1. Do you get these hazard ratios in this example by obtaining two univariate Cox regression analysis for patients >65 years and for patients <65 years?

  2. If I am right with my guess in 1), is there a way to perform the analysis easily with "coxph" and "forest_model", I mean, to transfer all the specific hazard ratios for each subgroup and also to calculate the p for interaction?

I really appreciate your effort! Thank you for your help!

@jgarces02
Copy link
Author

That's a good point. I don't have any idea how they performed this analysis, I've took a glance to their paper and it's not clear for me, sorry.

I guess that, as you said in point 1, they might have made two (or more) Cox regressions interchanging the reference group in each one and obtaining two different HR (and the corresponding P-value)... but this's only a supposition, maybe you can ask to the corresponding author.

I don't know how forest_plot will take these results... maybe you should to combine in some way and test if this package works. If it doesn't work, another solution could be create a data.frame and try this other package forestplot that'd allow you to work with tables.

PD: I think the interaction you mentioned is another kind of topic, it must be included in the cox analysis itself (some like ~var1*var2), forest_plot doesn't calculate P-values, it only shows results...

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

No branches or pull requests

3 participants