predrisk_grp_prcnt: Cut data into percentile groups

View source: R/predrisk_grp_prcnt.R

predrisk_grp_prcntR Documentation

Cut data into percentile groups

Description

predrisk_grp_prcnt() is a simple wrapper for cut that is meant to be used to create an input value for scalib_gnd_manual() (specifically, the group input argument).

Usage

predrisk_grp_prcnt(x, g, na.rm = FALSE, type = 7)

Arguments

x

(numeric vector) a numeric vector which will be converted to a vector of integers by cutting.

g

(numeric value) the desired number of percentile groups. For example, g = 10 gives decile groups.

na.rm

(logical value) if TRUE, any NA and NaN values are removed from x before the quantiles are computed.

type

(integer value between 1 and 9) see quantile for details.

Value

a numeric vector with integer values.

Examples


set.seed(32987)
predrisk_grp_prcnt(sort(runif(100)), g = 10)


bcjaeger/survival.calib documentation built on June 15, 2022, 7:47 a.m.