create_randomised_groups {familiar}R Documentation

Create randomised groups Creates randomised groups, e.g. for tests that depend on splitting (continuous) data into groups, such as the Hosmer-Lemeshow test

Description

The default fast mode is based on random sampling, whereas the slow mode is based on probabilistic joining of adjacent groups. As the name suggests, fast mode operates considerably more efficient.

Usage

create_randomised_groups(
  x,
  y = NULL,
  sample_identifiers,
  n_max_groups = NULL,
  n_min_groups = NULL,
  n_min_y_in_group = NULL,
  n_groups_init = 30,
  fast_mode = TRUE
)

Arguments

x

Vector with data used for sorting. Groups are formed based on adjacent values.

y

Vector with markers, e.g. the events. Should be 0 or 1 (for an event).

sample_identifiers

data.table with sample_identifiers. If provide, a list of grouped sample_identifiers will be returned, and integers otherwise.

n_max_groups

Maximum number of groups that need to be formed.

n_min_groups

Minimum number of groups that need to be formed.

n_min_y_in_group

Minimum number of y=1 in each group for a valid group.

n_groups_init

Number of initial groups (default: 30)

fast_mode

Enables fast randomised grouping mode (default: TRUE)

Details

Creates randomised groups, e.g. for tests that depend on splitting (continuous) data into groups, such as the Hosmer-Lemeshow test

Value

List of group sample ids or indices.


[Package familiar version 1.5.0 Index]