Learn R Programming

wintime (version 0.2.0)

perm: Resample using permutations

Description

This function reruns the desired wintime package method on a given number of permutations. This resampling method is recommended for the Expected win time (EWT) and Restricted mean survival in favor of treatment (RMT) methods.

Usage

perm(
  type,
  rmst_restriction,
  model,
  n,
  m,
  Time,
  Delta,
  trt,
  cov,
  z_ewtr,
  z_comp,
  resample_num,
  seed
)

Value

A vector of length resample_num containing the treatment effect estimates (for type='max' these are z-statistics) for each permutation.

Arguments

type

A string value indicating the wintime package method that will run with resampling.

rmst_restriction

The RMT cutoff value (days).

model

A string value indicating the model used on observed data ('markov' or 'km').

n

The total number of trial participants.

m

The number of events in the hierarchy.

Time

A m x n matrix of event times (days). Rows should represent events and columns should represent participants. Event rows should be in increasing order of clinical severity.

Delta

A m x n matrix of event indicators. Rows should represent events and columns should represent participants. Event rows should be in increasing order of clinical severity.

trt

A numeric vector of treatment arm indicators (1 for treatment, 0 for control).

cov

A n x p matrix of covariate values, where p is the number of covariates. Rows should represent participants and columns should represent covariate values.

z_ewtr

The Z-statistic of EWTR.

z_comp

The Z-statistic of the composite event approach.

resample_num

The number of desired permutations.

seed

The seed used for random number generation.