permLR: Convenience function which calls createPermGS and nextStage...

Description Usage Arguments Value Examples

View source: R/permLR.R

Description

Convenience function which calls createPermGS and nextStage to perform fixed sample size permutation test without imputation

Usage

1
2
3
4
permLR(formula, data, B = 1000, alpha = 0.05, pool = TRUE,
  type = c("logrank", "Gehan-Breslow", "Tarone-Ware", "Prentice",
  "Prentice-Marek", "Andersen-Borgan-Gill-Keiding", "Fleming-Harrington",
  "Self"))

Arguments

formula

a formula object, as used by coxph, left hand side must be a 'Surv' object, right hand side must only consist of a factor (treatment indicator) and optionally a special strata() term identifying the permutation strata

data

a data.frame or list containing the variables in "formula", by default "formula" is evaluated in the parent frame

B

number of random permutations (default: 1000)

alpha

significance level (default: 0.05)

pool

if TRUE impute event times from Kaplan-Meier estimator calculated from pooled data

type

logrank weights to be used with coin::logrank_trafo

Value

An object of class permGS

Examples

1
2
3
4
5
6
7
## Two-sided permutation test
T <- rexp(100) ## event times
Z <- rbinom(100, 1, 0.5)  ## treatment assignment
C <- rexp(100) ## drop-out times
data <- data.frame(time=pmin(T,C), status=T<=C, Z=Z)
x <- permLR(Surv(time, status) ~ Z, data, alpha=c(0.025, 0.025))
summary(x)

mbrueckner/permGS documentation built on May 22, 2019, 12:57 p.m.