Learn R Programming

BuyseTest (version 2.4.0)

calcPeron: internal functions for BuyseTest - initialization

Description

Functions called by BuyseTest to initialize the arguments.

Usage

calcPeron(
  data,
  model.tte,
  fitter,
  args,
  method.score,
  treatment,
  level.treatment,
  endpoint,
  endpoint.TTE,
  endpoint.UTTE,
  status,
  status.TTE,
  status.UTTE,
  D.TTE,
  D.UTTE,
  level.strata,
  n.strata,
  strata,
  threshold,
  restriction,
  precompute,
  iidNuisance,
  out
)

initializeArgs( status, correction.uninf = NULL, cpus = NULL, data, endpoint, formula, hierarchical = NULL, keep.pairScore = NULL, method.inference = NULL, scoring.rule = NULL, pool.strata = NULL, model.tte, n.resampling = NULL, strata.resampling = NULL, name.call, neutral.as.uninf = NULL, add.halfNeutral = NULL, operator = NULL, censoring, restriction, option, seed = NULL, strata, threshold, trace = NULL, treatment, type, weightEndpoint = NULL, weightObs = NULL, envir )

initializeData( data, type, endpoint, Uendpoint, D, scoring.rule, status, Ustatus, method.inference, censoring, strata, treatment, hierarchical, copy, keep.pairScore, endpoint.TTE, status.TTE, iidNuisance, weightEndpoint, weightObs )

initializeFormula(x, hierarchical, envir)

calcSample(envir, method.inference)

Arguments

Author

Brice Ozenne

Details

initializeArgs: Normalize the argument

  • scoring.rule, pool.strata, neutral.as.uninf, add.halfNeutral, keep.pairScore, n.resampling, seed, cpus, trace: set to default value when not specified.

  • formula: call initializeFormula to extract arguments.

  • type: convert to numeric.

  • status: only keep status relative to TTE endpoint. Set to NULL if no TTE endpoint.

  • threshold: set default threshold to 1e-12. 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.

  • scoring.rule: convert to numeric.

initializeFormula: extract treatment, type, endpoint, threshold, status, 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.