Hami
March 4, 2021, 8:35pm
1
I am trying to develop a hazard plot for intubation risk in PE patients. I already have a survival plot using this syntax
library ("survival")
library ("survminer")
library ("ggplot2")
library (dplyr)
fit <- survfit(Surv(time,died)~ PE, data = df1)
df1<- print (ggsurvplot(fit, data = df1,risk.table="percentage", ggtheme = theme_minimal(), legend.title = "Pulmonary Embolism", legend.labs = c("Negative", "Positive")))
I was wondering if there was a way to plot hazard curve(down up) instead of survival curve( up down) in the survminer package. I would like to use survminer for consistency.
Hami:
data = df1
See the FAQ: How to do a minimal reproducible example reprex for beginners .
Better chance of a useful answer if reverse-engineering the problem isn't required.
Hami
March 4, 2021, 11:08pm
4
if any one can just write a sample code to plot hazard curve(not survival curve) via survminer package, it will answer my question.
A practical survminer reference for ggsurvplot(): start from a basic survival curve and add, one element at a time, the number-at-risk table, 95% confidence bands, the log-rank p-value on the plot, median-survival lines, censoring marks, a...
See cum hazard?
But, the point is its not the respondent job to build the sample code. You should have been able to produce a reprex using say the lung survival data.
Hami
March 4, 2021, 11:21pm
6
Appreciate the help. Thanks so much!