library(gt) library(dplyr) library(tibble) #library(gsDesign2) devtools::load_all()
enrollRates <- tibble(duration = c(2, 1, 2), rate = c(5, 10, 20)) failRates <- tibble(duration = c(1, 1, 1),failRate = c(.05, .02, .01), dropoutRate = .01) totalDuration <- 20 x1 <- gsDesign::eEvents(lambda = failRates$failRate, S = failRates$duration[1 : (nrow(failRates) - 1)], eta = failRates$dropoutRate, gamma = enrollRates$rate, R = enrollRates$duration, T = totalDuration)$d x2 <- eEvents_df_(enrollRates, failRates, totalDuration, simple = TRUE) x3 <- eEvents_df(enrollRates, failRates, totalDuration, simple = TRUE) tibble(method = c("gsDesign", "old version", "new version"), exp_events = c(x1, x2, x3)) %>% gt()
enrollRates <- tibble(duration = c(1, 1, 8), rate = c(3, 2, 0)) failRates <- tibble(duration = c(4, Inf), failRate = c(.03, .06), dropoutRate = c(.001, .002)) totalDuration <- 7 x <- eEvents_df(enrollRates, failRates, totalDuration, simple = FALSE) %>% data.frame() # expected checked with alternate calculations in gsSurvNPH vignette y <- data.frame(t = c(0, 4), failRate = c(0.03, 0.06), Events = c(0.5642911, 0.5194821)) x %>% gt() %>% tab_header(title = "From gsDesign2 new version") y %>% gt() %>% tab_header(title = "From gsSurvNPH vignette")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.