radsl {random.cdisc.data}R Documentation

Subject-Level Analysis Dataset (ADSL)

Description

[Stable]

The Subject-Level Analysis Dataset (ADSL) is used to provide the variables that describe attributes of a subject. ADSL is a source for subject-level variables used in other analysis data sets, such as population flags and treatment variables. There is only one ADSL per study. ADSL and its related metadata are required in a CDISC-based submission of data from a clinical trial even if no other analysis data sets are submitted.

Usage

radsl(
  N = 400,
  study_duration = 2,
  seed = NULL,
  with_trt02 = TRUE,
  na_percentage = 0,
  na_vars = list(AGE = NA, SEX = NA, RACE = NA, STRATA1 = NA, STRATA2 = NA, BMRKR1 =
    c(seed = 1234, percentage = 0.1), BMRKR2 = c(1234, 0.1), BEP01FL = NA),
  ae_withdrawal_prob = 0.05,
  cached = FALSE
)

Arguments

N

(numeric)
Number of patients.

study_duration

(numeric)
Duration of study in years.

seed

(numeric)
Seed to use for reproducible random number generation.

with_trt02

(logical)
Should period 2 be added.

na_percentage

(proportion)
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 (numeric)
    The seed to be used for this element - can be NA.

  • percentage (proportion)
    Percentage of elements to be replaced with NA. If NA, na_percentage is used as a default.

ae_withdrawal_prob

(proportion)
Probability that there is at least one Adverse Event leading to the withdrawal of a study drug.

cached

boolean whether the cached ADSL data cadsl should be returned or new data should be generated. If set to TRUE then the other arguments to radsl will be ignored.

Details

One record per subject.

Keys: STUDYID, USUBJID

Value

data.frame

Examples

adsl <- radsl(N = 10, study_duration = 2, seed = 1)
adsl

adsl <- radsl(
  N = 10, seed = 1,
  na_percentage = 0.1,
  na_vars = list(
    DTHDT = c(seed = 1234, percentage = 0.1),
    LSTALVDT = c(seed = 1234, percentage = 0.1)
  )
)
adsl

adsl <- radsl(N = 10, seed = 1, na_percentage = .1)
adsl

[Package random.cdisc.data version 0.3.15 Index]