Skip to content

Commit

Permalink
Update script to generate MBdelayed.rda
Browse files Browse the repository at this point in the history
  • Loading branch information
jdblischak committed Nov 3, 2023
1 parent 0ddb0d6 commit 3ad6948
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion R/MBdelayed.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' under the above scenario.
#'
#' @format
#' A tibble with 200 rows and xx columns:
#' A tibble with 200 rows and 4 columns:
#' - `tte`: Time to event.
#'
#' @references
Expand Down
30 changes: 16 additions & 14 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
## code to prepare `DATASET` dataset goes here
## code to prepare `MBdelayed` dataset goes here
library(simtrial)
library(tibble)
set.seed(6671)
ds <- simPWSurv(
ds <- sim_pw_surv(
n = 200,
enrollRates = tibble(rate = 200 / 12, duration = 12),
failRates = tribble(
~Stratum, ~Period, ~Treatment, ~duration, ~rate,
"All", 1, "Control", 42, log(2) / 15,
"All", 1, "Experimental", 6, log(2) / 15,
"All", 2, "Experimental", 36, log(2) / 15 * 0.6
block = c(rep("control", 2), rep("experimental", 2)),
enroll_rate = tibble(rate = 200 / 12, duration = 12),
fail_rate = tribble(
~stratum, ~period, ~treatment, ~duration, ~rate,
"All", 1, "control", 42, log(2) / 15,
"All", 1, "experimental", 6, log(2) / 15,
"All", 2, "experimental", 36, log(2) / 15 * 0.6
),
dropoutRates = tribble(
~Stratum, ~Period, ~Treatment, ~duration, ~rate,
"All", 1, "Control", 42, 0,
"All", 1, "Experimental", 42, 0
dropout_rate = tribble(
~stratum, ~period, ~treatment, ~duration, ~rate,
"All", 1, "control", 42, 0,
"All", 1, "experimental", 42, 0
)
)
# cut data at 24 months after final enrollment
MBdelayed <- ds %>% cutData(max(ds$enrollTime) + 24)
MBdelayed <- ds %>% cut_data_by_date(max(ds$enroll_time) + 24)

usethis::use_data("MBdelayed")
usethis::use_data(MBdelayed, overwrite = TRUE)
Binary file modified data/MBdelayed.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion man/MBdelayed.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ad6948

Please sign in to comment.