Function for generating random Exposure Analysis Dataset for a given Subject-Level Analysis Dataset.

radex(
  ADSL,
  param = c("Dose administered during constant dosing interval",
    "Number of doses administered during constant dosing interval",
    "Total dose administered", "Total number of doses administered"),
  paramcd = c("DOSE", "NDOSE", "TDOSE", "TNDOSE"),
  paramu = c("mg", " ", "mg", " "),
  parcat1 = c("INDIVIDUAL", "OVERALL"),
  parcat2 = c("Drug A", "Drug B"),
  visit_format = "WEEK",
  n_assessments = 5L,
  n_days = 5L,
  max_n_exs = 6L,
  lookup = NULL,
  seed = NULL,
  na_percentage = 0,
  na_vars = list(AVAL = c(NA, 0.1), AVALU = c(NA), 0.1),
  cached = FALSE
)

Arguments

ADSL

Subject-Level Analysis Dataset (ADSL).

param

As character string. list of parameter values.

paramcd

As character string. list of parameter code values.

paramu

As character vector of parameter unit value

parcat1

Individual/Overall dose amount

parcat2

Type of drug received Drug A / Drug B

visit_format

Type of visit either "WEEK" or "CYCLE".

n_assessments

Number of weeks or cycles.

n_days

Number of days within cycle.

max_n_exs

As numeric. maximum number of exposures

lookup

control lookup process

seed

Seed for random number generation.

na_percentage

(numeric) Default percentage of values to be replaced by NA

na_vars

(list) A named list where the name of each element is a column name of ds. Each element of this list should be a numeric vector with two elements

  • seed The seed to be used for this element - can be left NA

  • percentage How many element should be replaced. 0 is 0 % 1 is 100 %, can be left NA and default percentage is used. This will overwrite default percentage (percentage argument))

cached

boolean whether the cached ADEX data cadex should be returned or new data should be generated. If set to TRUE then the other arguments to radex will be ignored.

Value

data.frame

Details

One record per each record in the corresponding SDTM domain.

Keys: STUDYID USUBJID EXSEQ PARAMCD PARCAT1 ASTDTM AVISITN

Examples

library(random.cdisc.data)
library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union

ADSL <- radsl(N = 10, study_duration = 2, seed = 1)
ADEX <- radex(ADSL, seed = 2)