Cox Models Forest

Authors

[Editor] Hu Zheng;

[Contributors]

Cox model forest is a visual representation of a COX model that constructs a risk forest map to facilitate variable screening.

Setup

  • System Requirements: Cross-platform (Linux/MacOS/Windows)

  • Programming language: R

  • Dependent packages: ezcox

# Install packages
if (!requireNamespace("ezcox", quietly = TRUE)) {
  install.packages("ezcox")
}

# Load packages
library(ezcox)

Data Preparation

The loaded data are time,status and multiple variable factor.

# Load data
data <- read.delim("files/Hiplot/053-ezcox-data.txt", header = T)

# View data
head(data)
  time status sex ph.ecog age
1  306      2   1       1  74
2  455      2   1       0  68
3 1010      1   1       0  56
4  210      2   1       1  57
5  883      2   1       0  60
6 1022      1   1       1  74

Visualization

# Cox Models Forest
p <- show_forest(
  data = data,
  covariates = c("sex", "ph.ecog"),
  controls = "age",
  merge_models = F,
  drop_controls = F,
  add_caption = T
)

p
FigureΒ 1: Cox Models Forest

The first column of the table shows the variables and sample numbers, the second column shows the forest plot, and the third column shows the CI 95% confidence interval range, its mean and P values.

Forest map interpretation.

The middle vertical line represents the invalid line, the horizontal line represents the 95% confidence interval of the variable factor, and the length represents the magnitude of the confidence interval. If the confidence interval of a variable factor intersects the invalid line, the variable factor is considered to have no statistical significance, and the position of the square is the point estimation of HR.

Age is the control variable.

The incidence of the ph.ecog factor is greater than that of the age factor, and the ph.ecog factor increases the occurrence of survival (P<0.001, statistically significant).

The incidence of sex is less than that of age, and sex reduces the incidence of survival (P =0.002<0.05, statistically significant).