I created a plot using ggcompetingrisks that is illegible. I would like to color code the time periods and differentiate the risk groups by using dashed vs dotted lines. Right now it's flipped.
p3 <- ggcompetingrisks(fit = TimePer_fit,
multiple_panels = F,
ggtheme = theme_minimal(),
coef = 1.96, #95% CI
conf.int = F,
xlim = c(0, 45),
ylim = c(0, 0.5),
xlab = "Days",
ylab = "Probability",
title = "Cumulative Incidence by Time Period") +
theme(plot.title = element_text(hjust = 0.5), #center title
axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = 0)), #pad y axis label
axis.title.x = element_text(margin = margin(t = 10, r = 0, b = 0, l = 0))) + #pad x axis label
scale_color_manual(labels = c("risk 1", "risk 2"),
values = c("#F8766D", "619CFF"),
name = element_blank()) + # do not name legend
scale_linetype_manual(labels = c("Period 1","Period 2","Period 3","Period 4", "Period 5"),
values = c("solid", "longdash", "dashed","twodash", "dotted"),
name = element_blank())


