Skip to content

Commit

Permalink
756 replace scda by random.cdisc.data (#760)
Browse files Browse the repository at this point in the history
#756

close #756 

modified test to adapt to the new data.

thank you for the review
  • Loading branch information
BFalquet authored Jul 1, 2024
1 parent 8d4cad3 commit 6d3ccd3
Show file tree
Hide file tree
Showing 38 changed files with 4,521 additions and 4,641 deletions.
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' - `adsub`
#' - `adtte`
#' - `advs`
#' @source based on `scda::synthetic_cdisc_data("rcd_2022_06_27")`
#' @source based on package `random.cdisc.data`
"syn_data"


Expand Down
23 changes: 14 additions & 9 deletions data-raw/syn_data_creation.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
#' @export
#' @rdname syn_test_data
syn_test_data <- function() {
sd <- scda::synthetic_cdisc_data("rcd_2022_06_27")
sd$adhy <- NULL
sd$adpp <- NULL
sd$adqs <- NULL
sd$adtr <- NULL
sd$adpc <- NULL
sd$adab <- NULL
# to avoid bug
attr(sd, "data_from") <- NULL
sd <- list()
sd$adsl <- random.cdisc.data::cadsl
sd$adae <- random.cdisc.data::cadae
sd$adaette <- random.cdisc.data::cadaette
sd$adcm <- random.cdisc.data::cadcm
sd$addv <- random.cdisc.data::caddv
sd$adeg <- random.cdisc.data::cadeg
sd$adex <- random.cdisc.data::cadex
sd$adlb <- random.cdisc.data::cadlb
sd$admh <- random.cdisc.data::cadmh
sd$adrs <- random.cdisc.data::cadrs
sd$adsub <- random.cdisc.data::cadsub
sd$adtte <- random.cdisc.data::cadtte
sd$advs <- random.cdisc.data::cadvs

# useful for ext01
group <- list(
Expand Down
Binary file modified data/syn_data.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion man/syn_data.Rd

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

158 changes: 79 additions & 79 deletions tests/testthat/_snaps/ael02.md

Large diffs are not rendered by default.

172 changes: 86 additions & 86 deletions tests/testthat/_snaps/ael03.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions tests/testthat/_snaps/aet05.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
Time to first occurrence of a grade 3-5 adverse event
Total patient-years at risk 10.3 6.3
Number of adverse events observed 12 14
AE rate per 100 patient-years 116.36 223.84
95% CI (50.53, 182.20) (106.59, 341.09)
AE rate per 100 patient-years 116.36 223.74
95% CI (50.53, 182.20) (106.54, 340.94)
Time to first occurrence of any adverse event
Total patient-years at risk 28.0 9.0
Number of adverse events observed 5 13
AE rate per 100 patient-years 17.86 143.84
95% CI (2.20, 33.51) (65.65, 222.03)
AE rate per 100 patient-years 17.86 143.75
95% CI (2.20, 33.51) (65.61, 221.89)
Time to first occurrence of any serious adverse event
Total patient-years at risk 29.9 7.6
Number of adverse events observed 4 14
Expand All @@ -57,7 +57,7 @@
Total patient-years at risk 22.0
Number of adverse events observed 8
AE rate per 100 patient-years 36.30
95% CI (11.15, 61.46)
95% CI (11.15, 61.45)
Time to first occurrence of any serious adverse event
Total patient-years at risk 9.4
Number of adverse events observed 13
Expand All @@ -75,13 +75,13 @@
Time to first occurrence of a grade 3-5 adverse event
Total patient-years at risk 10.3 6.3
Number of adverse events observed 12 14
AE rate per 100 patient-years 116.36 223.84
90% CI (70.83, 182.52) (141.55, 340.16)
AE rate per 100 patient-years 116.36 223.74
90% CI (70.83, 182.52) (141.48, 340.01)
Time to first occurrence of any adverse event
Total patient-years at risk 28.0 9.0
Number of adverse events observed 5 13
AE rate per 100 patient-years 17.86 143.84
90% CI (8.16, 35.11) (89.34, 221.88)
AE rate per 100 patient-years 17.86 143.75
90% CI (8.16, 35.11) (89.29, 221.74)
Time to first occurrence of any serious adverse event
Total patient-years at risk 29.9 7.6
Number of adverse events observed 4 14
Expand All @@ -99,7 +99,7 @@
Total patient-years at risk 22.0
Number of adverse events observed 8
AE rate per 100 patient-years 36.30
90% CI (19.67, 62.57)
90% CI (19.66, 62.57)
Time to first occurrence of any serious adverse event
Total patient-years at risk 9.4
Number of adverse events observed 13
Expand Down
48 changes: 24 additions & 24 deletions tests/testthat/_snaps/aet05_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,36 +33,36 @@
Number of occurrences of a grade 3-5 adverse event
Total patient-years at risk 41.4 44.2
Number of adverse events observed 56 54
AE rate per 100 patient-years 135.28 122.08
95% CI (99.85, 170.71) (89.52, 154.64)
AE rate per 100 patient-years 135.27 122.06
95% CI (99.84, 170.70) (89.50, 154.61)
Number of occurrences of any adverse event
Total patient-years at risk 41.4 44.2
Number of adverse events observed 29 49
AE rate per 100 patient-years 70.05 110.78
95% CI (44.56, 95.55) (79.76, 141.79)
AE rate per 100 patient-years 70.05 110.76
95% CI (44.55, 95.55) (79.75, 141.77)
Number of occurrences of any serious adverse event
Total patient-years at risk 41.4 44.2
Number of adverse events observed 9 36
AE rate per 100 patient-years 21.74 81.39
95% CI (7.54, 35.94) (54.80, 107.97)
AE rate per 100 patient-years 21.74 81.37
95% CI (7.54, 35.94) (54.79, 107.95)
\s\n C: Combination
(N=15)
—————————————————————————————————————————————————————————————————————
Number of occurrences of a grade 3-5 adverse event
Total patient-years at risk 44.4
Number of adverse events observed 95
AE rate per 100 patient-years 214.02
95% CI (170.98, 257.05)
AE rate per 100 patient-years 214.00
95% CI (170.97, 257.04)
Number of occurrences of any adverse event
Total patient-years at risk 44.4
Number of adverse events observed 56
AE rate per 100 patient-years 126.16
95% CI (93.12, 159.20)
AE rate per 100 patient-years 126.15
95% CI (93.11, 159.19)
Number of occurrences of any serious adverse event
Total patient-years at risk 44.4
Number of adverse events observed 60
AE rate per 100 patient-years 135.17
95% CI (100.97, 169.37)
AE rate per 100 patient-years 135.16
95% CI (100.96, 169.36)

---

Expand All @@ -75,34 +75,34 @@
Number of occurrences of a grade 3-5 adverse event
Total patient-years at risk 41.4 44.2
Number of adverse events observed 56 54
AE rate per 100 patient-years 135.28 122.08
90% CI (108.05, 167.66) (97.10, 151.89)
AE rate per 100 patient-years 135.27 122.06
90% CI (108.05, 167.65) (97.09, 151.86)
Number of occurrences of any adverse event
Total patient-years at risk 41.4 44.2
Number of adverse events observed 29 49
AE rate per 100 patient-years 70.05 110.78
90% CI (51.14, 94.12) (87.09, 139.29)
AE rate per 100 patient-years 70.05 110.76
90% CI (51.13, 94.12) (87.08, 139.26)
Number of occurrences of any serious adverse event
Total patient-years at risk 41.4 44.2
Number of adverse events observed 9 36
AE rate per 100 patient-years 21.74 81.39
90% CI (12.21, 36.40) (61.41, 106.19)
AE rate per 100 patient-years 21.74 81.37
90% CI (12.21, 36.40) (61.40, 106.17)
\s\n C: Combination
(N=15)
—————————————————————————————————————————————————————————————————————
Number of occurrences of a grade 3-5 adverse event
Total patient-years at risk 44.4
Number of adverse events observed 95
AE rate per 100 patient-years 214.02
90% CI (180.26, 252.59)
AE rate per 100 patient-years 214.00
90% CI (180.25, 252.57)
Number of occurrences of any adverse event
Total patient-years at risk 44.4
Number of adverse events observed 56
AE rate per 100 patient-years 126.16
90% CI (100.77, 156.36)
AE rate per 100 patient-years 126.15
90% CI (100.76, 156.35)
Number of occurrences of any serious adverse event
Total patient-years at risk 44.4
Number of adverse events observed 60
AE rate per 100 patient-years 135.17
90% CI (108.81, 166.34)
AE rate per 100 patient-years 135.16
90% CI (108.80, 166.33)

Loading

0 comments on commit 6d3ccd3

Please sign in to comment.