surv_plot_cluster: Plot a comparison between the unclusterized and clusterized...

View source: R/surv_plot.r

surv_plot_clusterR Documentation

Plot a comparison between the unclusterized and clusterized survival.

Description

Plot a comparison between the unclusterized and clusterized survival.

Usage

surv_plot_cluster(
  x,
  data,
  time = "time",
  event = "event",
  x_cluster = paste0(x, "Cluster"),
  ...
)

Arguments

x

name of the covariate column.

data

data.frame with the survival data.

time

name of the time variable column.

event

name of the censor/death variable column.

x_cluster

name of the clusterized covariate

...

extra arguments passed to 'survival::survfit'.

Details

This function uses the following wrapper to fit a KM estimate based on its arguments, for the clusterized and unclusterized column:

'survfit(formula(paste0("Surv(time,event)~", x)), data = data, ...)'

'survfit(formula(paste0("Surv(time,event)~", x_cluster)), data = data, ...)'

Value

a plotly graph comparing the clusterization of 'x' with regard to wx.


vitorcapdeville/survtools documentation built on Feb. 12, 2023, 12:01 p.m.