Description Usage Arguments Details Value Author(s) Examples
View source: R/derive_param_doseint.R
Adds a record for the dose intensity for each by group (e.g., subject and visit) where the source parameters are available.
1 2 3 4 5 6 7 8 9 | derive_param_doseint(
dataset,
by_vars,
set_values_to = vars(PARAMCD = "TNDOSINT"),
tadm_code = "TNDOSE",
tpadm_code = "TSNDOSE",
zero_doses = "Inf",
filter = NULL
)
|
dataset |
Input dataset The variables specified by the The variable specified by |
by_vars |
Grouping variables Permitted Values: list of variables |
set_values_to |
Variables to be set The specified variables are set to the specified values for the new
observations. For example Permitted Values: List of variable-value pairs |
tadm_code |
Total Doses Administered parameter code The observations where Permitted Values: character value |
tpadm_code |
Total Doses Planned parameter code The observations where Permitted Values: character value |
zero_doses |
Flag indicating logic for handling 0 planned or
administered doses for a Default: Permitted Values: No record is returned if either the planned ( If
If
|
filter |
Filter condition The specified condition is applied to the input dataset before deriving the new parameter, i.e., only observations fulfilling the condition are taken into account. Permitted Values: a condition |
The analysis value of the new parameter is derived as Total Dose / Planned Dose * 100
The input dataset with the new parameter rows added
Alice Ehmann
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | library(dplyr, warn.conflicts = FALSE)
library(lubridate, warn.conflicts = FALSE)
adex <- tibble::tribble(
~USUBJID, ~PARAMCD, ~VISIT, ~ANL01FL, ~ASTDT, ~AENDT, ~AVAL,
"P001", "TNDOSE", "V1", "Y", ymd("2020-01-01"), ymd("2020-01-30"), 59,
"P001", "TSNDOSE","V1", "Y", ymd("2020-01-01"), ymd("2020-02-01"), 96,
"P001", "TNDOSE", "V2", "Y", ymd("2020-02-01"), ymd("2020-03-15"), 88,
"P001", "TSNDOSE","V2", "Y", ymd("2020-02-05"), ymd("2020-03-01"), 88,
"P002", "TNDOSE", "V1", "Y", ymd("2021-01-01"), ymd("2021-01-30"), 0,
"P002", "TSNDOSE","V1", "Y", ymd("2021-01-01"), ymd("2021-02-01"), 0,
"P002", "TNDOSE", "V2", "Y", ymd("2021-02-01"), ymd("2021-03-15"), 52,
"P002", "TSNDOSE","V2", "Y", ymd("2021-02-05"), ymd("2021-03-01"), 0
)
derive_param_doseint(
adex,
by_vars=vars(USUBJID, VISIT),
set_values_to = vars(PARAMCD = "TNDOSINT"),
tadm_code = "TNDOSE",
tpadm_code = "TSNDOSE")
derive_param_doseint(
adex,
by_vars=vars(USUBJID, VISIT),
set_values_to = vars(PARAMCD = "TDOSINT2"),
tadm_code = "TNDOSE",
tpadm_code = "TSNDOSE",
zero_doses = "100")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.