find_cutoff: Find optimal survival cutoff.

View source: R/functions.R

find_cutoffR Documentation

Find optimal survival cutoff.

Description

Finds the optimal cutoff of a variable corresponding to the greatest difference in survival. The difference in survival is estimated with survdiff.

Usage

find_cutoff(data, time, event, variable, min_n = 2, .parallel = FALSE, ...)

Arguments

data

a data frame with the survival time, a numeric event index variable and the variable to be cut.

time

name of the survival time variables, needs to be numeric.

event

name of the binary event variable: 1 is event, 0 no event.

variable

name of the variable to be cut, needs to be numeric.

min_n

the minimal strata size.

.parallel

logical, should the search be run in parallel?

...

additional arguments passed to survdiff.

Details

In case, more minuma are find, the stratified data table is adjusted accordingly.

Value

an object of the 'survcut'. Contains te optimal cutoff value ('cutoff'), a tibble with the numeric variable of interest and and it's strata and a tibble with the cutoff values, test statistics and p values for the survival differences.


PiotrTymoszuk/kmOptimizer documentation built on May 10, 2022, 3:22 p.m.