diff --git a/devel/404.html b/devel/404.html index 3a75073b3e..76484976b4 100644 --- a/devel/404.html +++ b/devel/404.html @@ -81,21 +81,6 @@
TRTDURD
ADSL
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.
adsl <- dm %>% select(-DOMAIN)
adsl <- adsl %>% derive_var_trtdurd()
EOSDT
The ds_ext dataset:
ds_ext
The adsl dataset:
adsl
The derive_vars_dt() function allows to impute partial +
derive_vars_dt()
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".
highest_imputation = "M"
EOSSTT
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 @@
DSDECOD
DCSREAS
This call would return the input dataset with the column DCSREAS and DCSREASP added.
DCSREASP
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 @@
filter_add
RANDDT
This call would return the input dataset with the column RANDDT is added.
DTHDT
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 @@
DTHDTF
DTHCAUS
+ + 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 derive DTHCAUS: @@ -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, and DTHSEQ would store the xxSEQ 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) )
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 derive DTHCAUS:
derive_var_dthcaus()
@@ -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, and DTHSEQ would store the xxSEQ value of that domain). To add them, the @@ -626,8 +611,8 @@
DTHDOM
DTHSEQ
xxSEQ
LSTALVDT
Similarly to dthcaus_source(), the traceability +
dthcaus_source()
Similarly to dthcaus_source(), the traceability variables can be added by specifying the set_values_to argument in date_source().
set_values_to
date_source()
@@ -746,8 +731,8 @@ Derive the Last Date Known Alive (LSTALVDT)= list(ae = ae, adsl = adsl, lb = lb), mode = "last" )
AGEGR1
REGION1
SAFFL
The CDISC pilot EX domain data does not contain a dose +
EX
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)
ADT adex <- derive_vars_dt(adex, new_vars_prefix = "AST", dtc = EXSTDTC) adex <- derive_vars_dt(adex, new_vars_prefix = "AEN", dtc = EXENDTC)
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”:
derive_vars_dtm()
@@ -276,8 +261,8 @@ Derive/Impute Numeric Date/Time and Analysis Day (ADT= "last", new_vars_prefix = "AEN" )
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.
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 +
derive_vars_duration()
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 +
PARAMCD == "TDOSE"
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 @@
PARCAT1
"OVERALL"
ADEX
PARAMCD == "DOSE"
AVAL
ASTDT
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 @@
derive_param_doseint()
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.
NA
AVALCATx
ASEQ
ADT
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)) - - + +
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" )
ADT= VSDTC, highest_imputation = "M" )
Similarly, ADTM may be created using the function +
ADTM
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))
ADT advs <- derive_vars_dy(advs, reference_date = TRTSDT, source_vars = exprs(ADT))
advs <- derive_vars_dy(advs, reference_date = TRTSDT, source_vars = exprs(ADT))
PARAMCD
PARAM
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 @@
VSTESTCD
VSPOS
AVALC
BSA
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 @@
Body Surface Area
Body Mass Index
ADVS
constant_by_vars
Similarly, for ADEG, the parameters QTCBF +
ADEG
QTCBF
Similarly, for ADEG, the parameters QTCBF QTCBS and QTCL can be created with a function call. See example below for PARAMCD = QTCF.
QTCBS
QTCL
QTCF
APHASE
ONTRTFL
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 @@
ref_end_date
ANRIND
advs <- derive_var_anrind(advs)
BASETYPE
ABLFL
Note: Additional examples of the +
Note: Additional examples of the derive_var_extreme_flag() function can be found above.
derive_var_extreme_flag()
Lastly, the BASE, BASEC and BNRIND columns can be derived using the @@ -716,8 +701,8 @@
BASE
BASEC
BNRIND
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.
restrict_derivation()
R2BASE
ANL01FL
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 @@
SYSBP
DIABP
RESP
TRTA
TRTP
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
In the following example a time-to-event parameter for each preferred term in the AE dataset is derived.
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 ) ) - - + +
# define time to first adverse event event # ttae <- event_source( dataset_name = "ae", @@ -733,8 +718,8 @@ Deriving Time-to-Even PARCAT2 = AEDECOD ) )
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 @@
derive_vars_merged_lookup()
derive_var_merged_summary()
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 @@
derive_vars_joined()
join_vars
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 @@
derive_var_joied_exist_flag()
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.
derive_var_extreme_dt()
derive_extreme_records()
Here is an example of how to achieve the same with +
Here is an example of how to achieve the same with using call_derivation(), where any different arguments are passed using params():
call_derivation()
params()
@@ -237,8 +222,8 @@ Call Derivation= exprs(USUBJID, VSTESTCD), order = exprs(VSORRES, VSSEQ) )
In the example, you can see how in these higher order functions, +
In the example, you can see how in these higher order functions, derivation is where the user supplies the name of the derivation function to apply, with no trailing parentheses required. Then variable_params is used to pass a list of the @@ -273,8 +258,8 @@
derivation
variable_params
Developing your ADaM scripts this way using +
Developing your ADaM scripts this way using call_derivation() could give the following benefits:
As you can see in the example, the derivation_slice +
derivation_slice
As you can see in the example, the derivation_slice ordering is important. Here we addressed all the AEs on or after study day 1 first, and then we used filter = TRUE option to catch all remaining records (in this case pre-treatment AEs).
filter = TRUE
The order is only important when the slices are not mutually +
The order is only important when the slices are not mutually exclusive, so in the above case the moderate AE slice could have been above the severe AE slice, for example, and there would have been no difference to the result. However the third slice had to come last to diff --git a/devel/articles/hys_law.html b/devel/articles/hys_law.html index 3fcbd664b9..b6a01449a3 100644 --- a/devel/articles/hys_law.html +++ b/devel/articles/hys_law.html @@ -83,21 +83,6 @@
CRITy
LBTESTCD
The last step would be binding these rows back to whatever previous +
The last step would be binding these rows back to whatever previous dataset is appropriate based on your data specifications, in this case, it would be best suited to bind back to our adlb_annotated object.
adlb_annotated
adlbhy <- adlb_annotated %>% bind_rows(hylaw_params)
Here we demonstrated what is the base-case that may be asked of as a +
Here we demonstrated what is the base-case that may be asked of as a trial programmer. The reality is that Hy’s Law and assessing potential DILI events can get rather complex quite quickly. Differences in assessment across organizations and specific trials might require diff --git a/devel/articles/imputation.html b/devel/articles/imputation.html index 2c09b4389a..dbd03ba1fc 100644 --- a/devel/articles/imputation.html +++ b/devel/articles/imputation.html @@ -83,21 +83,6 @@