
First Significant Cutpoint per Feature
Source:R/batch_cutpoint_survdiff.R
first_significant_cutpoint.RdFrom the result of [batch_cutpoint_survdiff()], picks for each feature and each `alpha` the first cutpoint with `p < alpha`, scanning from the lowest cutpoint when the univariate Cox coefficient is positive and from the highest otherwise (the most inclusive split on the risk side).
Usage
first_significant_cutpoint(x, alpha = c(0.1, 0.05, 0.001))Value
A tibble with one row per feature and `alpha` that has a significant cutpoint (the columns of `x` plus `alpha`).
Examples
set.seed(1)
d <- data.frame(time = rexp(80), status = rbinom(80, 1, 0.7), x = rnorm(80))
first_significant_cutpoint(batch_cutpoint_survdiff(d, "time", "status", "x"), alpha = 0.5)
#> # A tibble: 1 × 10
#> feature cutpoint n_low n_high chisq p p_type cox_coef cox_p alpha
#> <chr> <dbl> <int> <int> <dbl> <dbl> <ord> <dbl> <dbl> <dbl>
#> 1 x -1.46 1 79 0.627 0.428 p >= 0.1 0.00479 0.975 0.5