I would like to plot results of multiple cox proportional univariate analysis into one forest plot. Thanksfully this is possible by using the forest_model package in R.
I was wondering if it is possible to use the ‘panel’ argument of the function forest_model() while also using the ‘model_list’ argument.
When only using one analysis with forest_model() everything works fine:
panels <- list(
list(width = 0.03),
list(width = 0.1, display = ~variable, fontface = "bold", heading = "Xariable"),
list(width = 0.1, display = ~level),
list(width = 0.05, display = ~n, hjust = 1, heading = "N"),
list(width = 0.03, item = "vline", hjust = 0.5),
list(
width = 0.55,
item = "forest",
hjust = 0.5,
heading = "Hazard ratio",
linetype = "dashed",
line_x = 0
),
list(width = 0.03, item = "vline", hjust = 0.5),
list(
width = 0.12,
display = ~ ifelse(reference, "Reference", sprintf("%0.2f (%0.2f - %0.2f)",trans(estimate), trans(conf.low), trans(conf.high))),
display_na = NA,
heading="95% CI (Range)"
),
list(
width = 0.05,
display = ~ ifelse(reference, "", format.pval(p.value, digits = 1, eps = 0.001)),
display_na = NA, hjust = 1, heading = "p"
),
list(width = 0.03)
)
forest_model(coxph(Surv(Duration, AliveDead) ~ Gender, pretty_Datensatz_3), panels, exponentiate=TRUE)
Plot with customization with the panel arguemnt
When using the model_list argument the customization done with the panels argument seems to be ignored.
coxVar1 <- coxph(Surv(Duration, AliveDead) ~ Gender, pretty_Datensatz_3)
# coxVar2 till coxVar8 in the same way
model_list <- list(Age = coxVar2, Gender = coxVar1, RRT = coxVar4, Catecholamine = coxVar5, InvVent = coxVar6, SAPS = coxVar3, TISS = coxVar7, DoV=coxVar8)
forest_model(model_list = model_list,merge_models =TRUE, panels)
I have already tried to use fewer list elements within model_list
but this did not change anything.
I have searched through Google and ChatGPT but this problem wasn’t addressed there. I also read through the documentation but either I missed something or there was no info about this.
Anyone any suggestions?
Felix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.