Skip to contents

Binary Cut-Off Transformation

Usage

binary_cutoff(name, int_cutoff, ext_cutoff)

Arguments

name

variable to transform

int_cutoff

cut-off for internal patients, numeric between 0 and 1

ext_cutoff

cut-off for external patients, numeric between 0 and 1

Value

Transformation function to be used in create_baseline_object(). Sets quantile values larger than cut-off value to TRUE otherwise FALSE.

Examples

# Creates a simple function, where `data` is a `BaselineDataFrame`:
function(data) {
  ext <- data$ext == 0
  q <- get_quantiles(data, name)
  ifelse(ext, q > int_cutoff, q > ext_cutoff)
}
#> function(data) {
#>   ext <- data$ext == 0
#>   q <- get_quantiles(data, name)
#>   ifelse(ext, q > int_cutoff, q > ext_cutoff)
#> }
#> <environment: 0x55d3b5ce2780>