### test-BuyseTest-CR.R --- ##---------------------------------------------------------------------- ## Author: Brice Ozenne, Eva Cantagallo ## Created: jul 12 2018 (16:58) ## Version: ## Last-Updated: May 1 2023 (10:07) ## By: Brice Ozenne ## Update #: 54 ##---------------------------------------------------------------------- ## ### Commentary: ## ### Change Log: ##---------------------------------------------------------------------- ## ### Code: if(FALSE){ library(testthat) library(BuyseTest) library(data.table) } library(prodlim) context("Check that BuyseTest with competing risks \n") ## * Gehan scoring rule (Maintainer: Brice) ## ** settings BuyseTest.options(check = TRUE, keep.pairScore = TRUE, method.inference = "none", pool.strata = "Buyse", trace = 0) alphaE.X <- 2 alphaCR.X <- 1 alphaE.Y <- 3 alphaCR.Y <- 2 alpha.cens <- 1.5 n <- 1e2 n.big <- 5e4 true.sHR <- c(0, 0.5, 1, 2) p.1C <- 0.55 v <- -0.30 ## ** Simulate data set.seed(10) df <- rbind(data.frame(time1 = rexp(n, rate = alphaE.X), time2 = rexp(n, rate = alphaCR.X), group = "1", stringsAsFactors = FALSE), data.frame(time1 = rexp(n, rate = alphaE.Y), time2 = rexp(n, rate = alphaCR.Y), group = "2", stringsAsFactors = FALSE)) df$time <- pmin(df$time1,df$time2) ## first event df$event <- (df$time2