internal-initialization {BuyseTest} | R Documentation

## internal functions for BuyseTest - initialization

### Description

Functions called by `BuyseTest` to initialize the arguments.

### Usage

    initializeArgs(alternative, name.call, censoring, cpus = NULL, data,
      endpoint, formula, keep.pairScore = NULL, method.tte = NULL,
      correction.uninf = NULL, model.tte, method.inference = NULL,
      n.resampling = NULL, neutral.as.uninf = NULL, operator, option,
      seed = NULL, strata, threshold, trace = NULL, treatment, type)

    initializeData(data, type, endpoint, method.tte, censoring, operator,
      strata, treatment, copy)

    initializeFormula(x)

    initializeSurvival_Peron(data, model.tte, treatment, level.treatment,
      endpoint, endpoint.UTTE, censoring, D.TTE, D.UTTE, type, strata,
      threshold, n.strata, out)

### Details

`initializeArgs`: Normalize the argument

- method.tte, neutral.as.uninf, keep.pairScore, n.resampling, seed, cpus, trace: set to default value when not specified.

- formula: call `initializeFormula` to extract arguments.

- type: convert to numeric.

- censoring: only keep censoring relative to TTE endpoint. Set to `NULL` if no TTE endpoint.

- threshold: set default threshold to 1e-12 expect for binary variable where it is set to 1/2. the rational being we consider a pair favorable if X>Y ie X>=Y+1e-12. When using a threshold e.g. 5 we want X>=Y+5 and not X>Y+5, especially when the measurement is discrete.

- data: convert to data.table object.

- method.tte: convert to numeric.

and create `Wscheme`.

`initializeFormula`: extract `treatment`, `type`, `endpoint`, `threshold`, `censoring`, `operator`, and `strata` from the formula.

`initializeData`: Divide the dataset into two, one relative to the treatment group and the other relative to the control group. Merge the strata into one with the interaction variable. Extract for each strata the index of the observations within each group. `initializeSurvival`: Compute the survival via KM.

[Package BuyseTest version 1.7 Index]