From cacf7ba49dc93d1b8107289711da30e65fb3587c Mon Sep 17 00:00:00 2001
From: GitHub Actions Advanced User Guides
Advanced User Guides
Advanced User Guides
Advanced User Guides
Note: We only display variables that were derived. A +
+Note: We only display variables that were derived. A user running this code will have additional adsl variables displayed. You can use the Choose Columns to Display button to add more variables into the table.
@@ -322,8 +307,8 @@
adsl <- adsl %>%
derive_var_trtdurd()
EOSDT
)= DSCAT == "DISPOSITION EVENT" & DSDECOD != "SCREEN FAILURE"
)The ds_ext
dataset:
The adsl
dataset:
The derive_vars_dt()
function allows to impute partial
+
The adsl
dataset:
The derive_vars_dt()
function allows to impute partial
dates as well. If imputation is needed and missing days are to be
imputed to the first of the month and missing months to the first month
of the year, set highest_imputation = "M"
.
EOSSTT
)= exprs(EOSSTT = format_eosstt(DSDECOD)),
missing_values = exprs(EOSSTT = "ONGOING")
)
-
-This call would return the input dataset with the column +
+This call would return the input dataset with the column
EOSSTT
added.
If the derivation must be changed, the user can create his/her own
function to map DSDECOD
to a suitable EOSSTT
@@ -442,8 +427,8 @@
DCSREAS
,
filter_add = DSCAT == "DISPOSITION EVENT" &
!(DSDECOD %in% c("SCREEN FAILURE", "COMPLETED", NA))
)
-
-This call would return the input dataset with the column +
+This call would return the input dataset with the column
DCSREAS
and DCSREASP
added.
If the derivation must be changed, the user can define that
derivation in the filter_add
argument of the function to
@@ -475,8 +460,8 @@
DCSREAS
,
new_vars = exprs(DCSREASP = DSTERM),
filter_add = DSCAT == "DISPOSITION EVENT" & DSDECOD %in% "OTHER"
)
-
-
+
+
RANDDT
)
@@ -494,8 +479,8 @@ RANDDT
))This call would return the input dataset with the column
RANDDT
is added.
DTHDT
)= "DTH",
dtc = DTHDTC
)This call would return the input dataset with the columns +
+This call would return the input dataset with the columns
DTHDT
added and, by default, the associated date imputation
flag (DTHDTF
) populated with the controlled terminology
outlined in the ADaM IG for date imputations. If the imputation flag is
@@ -576,8 +561,8 @@
DTHCAUS
)= "first",
dthcaus = AEDECOD
)
-
-+ +- -src_ds <- dthcaus_source( dataset_name = "ds", filter = DSDECOD == "DEATH" & grepl("DEATH DUE TO", DSTERM), @@ -585,8 +570,8 @@
Cause of Death (
DTHCAUS
)= "first", dthcaus = "Death in DS" )Once the sources are defined, the function +
+Once the sources are defined, the function
derive_var_dthcaus()
can be used to deriveDTHCAUS
:- -@@ -595,8 +580,8 @@Cause of Death (
DTHCAUS
)src_ae, src_ds, source_datasets = list(ae = ae, ds = ds_ext) )The function also offers the option to add some traceability +
+The function also offers the option to add some traceability variables (e.g.
DTHDOM
would store the domain where the date of death is collected, andDTHSEQ
would store thexxSEQ
value of that domain). To add them, the @@ -626,8 +611,8 @@Cause of Death (
DTHCAUS
)src_ae, src_ds, source_datasets = list(ae = ae, ds = ds_ext) )
LSTALVDT
)= list(ae = ae, adsl = adsl, lb = lb),
mode = "last"
)Similarly to dthcaus_source()
, the traceability
+
Similarly to dthcaus_source()
, the traceability
variables can be added by specifying the set_values_to
argument in date_source()
.
@@ -746,8 +731,8 @@Derive the Last Date Known Alive (
LSTALVDT
)= list(ae = ae, adsl = adsl, lb = lb), mode = "last" )
AGEGR1
or REGION1
= format_agegr1(AGE),
REGION1 = format_region1(COUNTRY)
)SAFFL
)
@@ -814,8 +799,8 @@ SAFFL
)= SAFFL,
condition = (EXDOSE > 0 | (EXDOSE == 0 & str_detect(EXTRT, "PLACEBO")))
)The CDISC pilot EX
domain data does not contain a dose
+
The CDISC pilot EX
domain data does not contain a dose
adjustment flag or the planned dose information. For demonstration
purposes, this will be added to the data.
@@ -257,8 +242,8 @@Derive/Impute Numeric Date/Time and Analysis Day (
ADT
adex <- derive_vars_dt(adex, new_vars_prefix = "AST", dtc = EXSTDTC) adex <- derive_vars_dt(adex, new_vars_prefix = "AEN", dtc = EXENDTC)
The next examples demonstrates the datetime imputation features +
+The next examples demonstrates the datetime imputation features
available in the derive_vars_dtm()
function, where the time
is imputed as “00:00:00”:
@@ -276,8 +261,8 @@Derive/Impute Numeric Date/Time and Analysis Day (
ADT= "last", new_vars_prefix = "AEN" )
The example above imputes the start date to the first first day of +
+The example above imputes the start date to the first first day of the month and imputes the end date to the last day of the month.
Please see the Date and Time Imputation for additional examples on calculating and imputing analysis dates.
@@ -288,8 +273,8 @@ADT= TRTSDT,
source_vars = exprs(ASTDT, AENDT)
)
-
-
+
+
The units of the calculated duration can also be changed. In this +
+The units of the calculated duration can also be changed. In this example, the duration is output as years:
adex <- adex %>%
@@ -314,8 +299,8 @@ Compute duration for a record= ASTDT,
end_date = AENDT
)
Please refer to the derive_vars_duration()
documentation
+
Please refer to the derive_vars_duration()
documentation
for detailed information on the input parameters.
It may be necessary to calculate additional intermediate values. For example, the cumulative doses received and cumulative planned doses may @@ -326,8 +311,8 @@
It may be of additional interest to turn a single record containing +
+It may be of additional interest to turn a single record containing dosing summary information into a set of multiple single records, each representing a single dose over the interval specified by the summary record. This is another approach to deriving a total dose parameter when @@ -340,8 +325,8 @@
A record with PARAMCD == "TDOSE"
is created with
+
A record with PARAMCD == "TDOSE"
is created with
PARCAT1
set to "OVERALL"
using the records in
ADEX
where PARAMCD == "DOSE"
by summing
AVAL
. In addition, the ASTDT
, and
@@ -495,8 +480,8 @@
Dose intensity can be calculated using the function +
+Dose intensity can be calculated using the function
derive_param_doseint()
. The planned dose and administered
dose are passed into the function and a new record is created with the
dose intensity calculation. Again, only those variables specified in the
@@ -517,8 +502,8 @@
The default calculation for dose intensity is: Administered Doses / +
+The default calculation for dose intensity is: Administered Doses / Planned Doses * 100.
Please see the derive_param_doseint()
documentation to
see how planned doses of 0 or NA
are handled.
AVALCATx
)TRUE ~ NA_character_
)
)
-
-
+
+
ASEQ
@@ -657,8 +642,8 @@ ASEQ
= exprs(PARCAT1, ASTDT, VISIT, VISITNUM, EXSEQ, PARAMN),
check_type = "error"
)ADSL
variables
diff --git a/devel/articles/bds_finding.html b/devel/articles/bds_finding.html
index 4337da4919..ee3baaef93 100644
--- a/devel/articles/bds_finding.html
+++ b/devel/articles/bds_finding.html
@@ -83,21 +83,6 @@ ADT
,
@@ -241,8 +226,8 @@ ADTExample calls:
advs <- derive_vars_dt(advs, new_vars_prefix = "A", dtc = VSDTC)
-
-If imputation is needed and the date is to be imputed to the first of
+
+If imputation is needed and the date is to be imputed to the first of
the month, the call would be:
advs <- derive_vars_dt(
@@ -251,8 +236,8 @@ Derive/Impute Numeric Date/Time and Analysis Day (ADT= VSDTC,
highest_imputation = "M"
)
-
-Similarly, ADTM
may be created using the function
+
+Similarly, ADTM
may be created using the function
derive_vars_dtm()
. Imputation may be done on both the date
and time components of ADTM
.
@@ -277,8 +262,8 @@ Derive/Impute Numeric Date/Time and Analysis Day (ADT
advs <-
derive_vars_dy(advs, reference_date = TRTSDT, source_vars = exprs(ADT))
-
-
+
+
PARAMCD
, PARAM
,
@@ -372,8 +357,8 @@ PARAMCD
, PARAM
,
by_vars = exprs(VSTESTCD)
)
#> All `VSTESTCD` are mapped.Please note, it may be necessary to include other variables in the +
+Please note, it may be necessary to include other variables in the
join. For example, perhaps the PARAMCD
is based on
VSTESTCD
and VSPOS
, it may be necessary to
expand this lookup or create a separate look up for
@@ -394,8 +379,8 @@
AVAL
, AVALC
)= VSSTRESN,
AVALC = VSSTRESC
)
-
-
+
+
BSA
,
@@ -418,8 +403,8 @@ BSA
,
get_unit_expr = VSSTRESU,
filter = VSSTAT != "NOT DONE" | is.na(VSSTAT)
)Likewise, function call below, to create parameter +
+Likewise, function call below, to create parameter
Body Surface Area
(BSA) and Body Mass Index
(BMI) for ADVS
domain. Note that if height is collected
only once use constant_by_vars
to specify the subject-level
@@ -444,8 +429,8 @@
BSA
,
filter = VSSTAT != "NOT DONE" | is.na(VSSTAT),
constant_by_vars = exprs(USUBJID)
)
-
-Similarly, for ADEG
, the parameters QTCBF
+
Similarly, for ADEG
, the parameters QTCBF
QTCBS
and QTCL
can be created with a function
call. See example below for PARAMCD
=
QTCF
.
BSA
,
dataset_add = select(param_lookup, -VSTESTCD),
by_vars = exprs(PARAMCD)
)
-
-
+
+
APHASE
,
@@ -575,8 +560,8 @@ ONTRTFL
)= TRTSDT,
ref_end_date = TRTEDT
)This function returns the original data frame with the column +
+This function returns the original data frame with the column
ONTRTFL
added. Additionally, this function does have
functionality to handle a window on the ref_end_date
. For
example, if on-treatment is defined as between treatment start and
@@ -620,8 +605,8 @@
ONTRTFL
)= AP01EDT,
span_period = TRUE
)
-
-
+
+
ANRIND
)
@@ -635,8 +620,8 @@ ANRIND
)The function is called as:
advs <- derive_var_anrind(advs)
BASETYPE
, ABLFL
,
@@ -688,8 +673,8 @@ BASETYPE
, ABLFL
,
),
filter = (!is.na(AVAL) & ADT <= TRTSDT & !is.na(BASETYPE))
)Note: Additional examples of the +
+Note: Additional examples of the
derive_var_extreme_flag()
function can be found above.
Lastly, the BASE
, BASEC
and
BNRIND
columns can be derived using the
@@ -716,8 +701,8 @@
BASETYPE
, ABLFL
,
source_var = ANRIND,
new_var = BNRIND
)
-
-
+
+
CHG
,
@@ -734,8 +719,8 @@ CHG
,
advs <- derive_var_chg(advs)
advs <- derive_var_pchg(advs)
If the variables should not be derived for all records, e.g., for +
+If the variables should not be derived for all records, e.g., for
post-baseline records only, restrict_derivation()
can be
used.
R2BASE
)= ANRLO,
new_var = R01ANRLO
)
-
-If the variables should not be derived for all records, e.g., for +
+If the variables should not be derived for all records, e.g., for
post-baseline records only, restrict_derivation()
can be
used.
ANL01FL
)),
filter = !is.na(AVISITN)
)
-
-Another common example would be flagging the worst value for a +
+Another common example would be flagging the worst value for a
subject, parameter, and visit. For this example, we will assume we have
3 PARAMCD
values (SYSBP
, DIABP
,
and RESP
). We will also assume high is worst for
@@ -834,8 +819,8 @@
ANL01FL
))
) %>%
arrange(STUDYID, USUBJID, BASETYPE, PARAMCD, AVISIT)
-
-
+
+
TRTA
, TRTP
)
@@ -873,8 +858,8 @@ ASEQ
= exprs(PARAMCD, ADT, AVISITN, VISITNUM, ATPTN),
check_type = "error"
)AVALCATx
)
@@ -902,8 +887,8 @@ AVALCATx
)avalcat_lookup,
by = exprs(PARAMCD, AVALCA1N)
)PARAMCD
)
@@ -1024,8 +1009,8 @@ PARAMC
PARAM = "Mean Arterial Pressure 2 (mmHg)"
)
)
Note that in practice for efficacy parameters you might use +
+Note that in practice for efficacy parameters you might use randomization date as the time to event origin date.
View(adsl)
-
-View(adrs)
-
-An event for progression free survival occurs if
+ +View(adrs)
+
+An event for progression free survival occurs if
In the following example a time-to-event parameter for each preferred term in the AE dataset is derived.
View(adsl)
-
-View(ae)
-
-+ ++ +View(ae)
- - + +# define time to first adverse event event # ttae <- event_source( dataset_name = "ae", @@ -733,8 +718,8 @@
Deriving Time-to-Even PARCAT2 = AEDECOD ) )
AVAL
)= STARTDT,
end_date = ADT
)ASEQ
)
@@ -767,8 +752,8 @@ ASEQ
)= exprs(PARAMCD),
check_type = "error"
)Here’s how all these above derived variables then look in the dataset.
- -Some further examples of “merged” functions are +
+Some further examples of “merged” functions are
derive_vars_merged_lookup()
to join a user-defined lookup
table as commonly used in BDS ADaMs or
derive_var_merged_summary()
to merge summarized values from
@@ -369,8 +354,8 @@
Now, let’s consider another example of +
+Now, let’s consider another example of
derive_vars_joined()
. For this we’ll need to additionally
use the join_vars
argument, which is where the user needs
to call out any variables from the additional dataframe being used in
@@ -398,8 +383,8 @@
The derive_vars_joined()
function could also be used to
+
The derive_vars_joined()
function could also be used to
join the original dataframe back with itself, which may be necessary if
you’re comparing across different observations. For example, the below
shows how a “nadir” calculation would be achieved which checks for the
@@ -421,8 +406,8 @@
There exists a further function +
+There exists a further function
derive_var_joied_exist_flag()
, which follows a similar
principle to the “joined” set as explained here. This can be used for
whenever one set of observations “confirms” another set in a dataframe,
@@ -464,8 +449,8 @@
Common further examples of usage of this set of functions could be +
+Common further examples of usage of this set of functions could be
using derive_var_extreme_dt()
for last known alive date
calculation or derive_extreme_records()
for creating
derived minimum or maximum value records.