Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

174 Refactor adcm #182

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
`Time to onset of ADA (Weeks)`, and `ADA Duration (Weeks)` to `PARAM` in `adab`.
* Add `AEWITHFL` variable to `adsl`.
* Add `ATIREL` variable to `admh`.
* Add variables `CMSTRTPT`, `CMENRTPT`, `ADURN`, and `ADURU` to `adcm`.

# random.cdisc.data 0.3.13

Expand Down
17 changes: 16 additions & 1 deletion R/radcm.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,22 @@ radcm <- function(ADSL, # nolint
dplyr::mutate(CMDOSFRQ = sample(c(
"Q4W", "QN", "Q4H", "UNKNOWN", "TWICE",
"Q4H", "QD", "TID", "4 TIMES PER MONTH"
), dplyr::n(), replace = TRUE))
), dplyr::n(), replace = TRUE)) %>%
dplyr::mutate(
# use 1 year as reference time point
CMSTRTPT = dplyr::case_when(
ASTDY <= 365 ~ "BEFORE",
ASTDY > 365 ~ "AFTER",
is.na(ASTDY) ~ "U"
),
CMENRTPT = dplyr::case_when(
EOSSTT %in% c("COMPLETED", "DISCONTINUED") ~ "BEFORE",
EOSSTT == "ONGOING" ~ "ONGOING",
is.na(EOSSTT) ~ "U"
),
ADURN = (AENDTM - ASTDTM) / 86400,
ADURU = "days"
)


# Optional WHO coding, which adds more `ATC` paths for randomly selected `CMDECOD`.
Expand Down
Binary file modified data/cadcm.RData
Binary file not shown.
12 changes: 12 additions & 0 deletions inst/metadata/ADCM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,15 @@ variables:
CMDOSFRQ:
label: Dosing Frequency per Interval
type: factor
CMSTRTPT:
label: Start Relative to Reference Time Point
type: factor
CMENRTPT:
label: End Relative to Reference Time Point
type: factor
ADURN:
label: Analysis Duration
type: integer
ADURU:
label: Analysis Duration Units
type: factor
2 changes: 1 addition & 1 deletion man/cadcm.Rd

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