Title: | Create Random ADaM Datasets |
---|---|
Description: | A set of functions to create random Analysis Data Model (ADaM) datasets and cached dataset. ADaM dataset specifications are described by the Clinical Data Interchange Standards Consortium (CDISC) Analysis Data Model Team. |
Authors: | Pawel Rucki [aut], Nick Paszty [aut], Jana Stoilova [aut], Joe Zhu [aut, cre], Davide Garolini [aut], Emily de la Rua [aut], Christopher DiPietrantonio [aut], Adrian Waddell [aut], F. Hoffmann-La Roche AG [cph, fnd] |
Maintainer: | Joe Zhu <[email protected]> |
License: | Apache License 2.0 |
Version: | 0.3.15 |
Built: | 2024-09-24 04:29:06 UTC |
Source: | https://github.com/insightsengineering/random.cdisc.data |
random.cdisc.data
PackagePackage to create random SDTM and ADAM datasets.
Maintainer: Joe Zhu [email protected]
Authors:
Pawel Rucki [email protected]
Nick Paszty [email protected]
Jana Stoilova [email protected]
Davide Garolini [email protected]
Emily de la Rua [email protected]
Christopher DiPietrantonio
Adrian Waddell [email protected]
Other contributors:
F. Hoffmann-La Roche AG [copyright holder, funder]
Apply label and variable ordering attributes to domains.
apply_metadata( df, filename, add_adsl = TRUE, adsl_filename = "metadata/ADSL.yml" )
apply_metadata( df, filename, add_adsl = TRUE, adsl_filename = "metadata/ADSL.yml" )
df |
( |
filename |
( |
add_adsl |
( |
adsl_filename |
( |
Data frame with metadata applied.
seed <- 1 adsl <- radsl(seed = seed) adsub <- radsub(adsl, seed = seed) yaml_path <- file.path(path.package("random.cdisc.data"), "inst", "metadata") adsl <- apply_metadata(adsl, file.path(yaml_path, "ADSL.yml"), FALSE) adsub <- apply_metadata( adsub, file.path(yaml_path, "ADSUB.yml"), TRUE, file.path(yaml_path, "ADSL.yml") )
seed <- 1 adsl <- radsl(seed = seed) adsub <- radsub(adsl, seed = seed) yaml_path <- file.path(path.package("random.cdisc.data"), "inst", "metadata") adsl <- apply_metadata(adsl, file.path(yaml_path, "ADSL.yml"), FALSE) adsub <- apply_metadata( adsub, file.path(yaml_path, "ADSUB.yml"), TRUE, file.path(yaml_path, "ADSL.yml") )
Cached ADAB data generated with seed = 1
data(cadab)
data(cadab)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 6916 rows and 21 columns.
Cached ADAE data generated with seed = 1
data(cadae)
data(cadae)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1934 rows and 92 columns.
Cached ADAETTE data generated with seed = 1
data(cadaette)
data(cadaette)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3600 rows and 66 columns.
Cached ADCM data generated with seed = 1
data(cadcm)
data(cadcm)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3685 rows and 83 columns.
Cached ADDV data generated with seed = 1
data(caddv)
data(caddv)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 119 rows and 66 columns.
Cached ADEG data generated with seed = 1
data(cadeg)
data(cadeg)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 13600 rows and 88 columns.
Cached ADEX data generated with seed = 1
data(cadex)
data(cadex)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 6400 rows and 79 columns.
Cached ADHY data generated with seed = 1
data(cadhy)
data(cadhy)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 20000 rows and 71 columns.
Cached ADLB data generated with seed = 1
data(cadlb)
data(cadlb)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 8400 rows and 102 columns.
Cached ADMH data generated with seed = 1
data(cadmh)
data(cadmh)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1934 rows and 67 columns.
Cached ADPC data generated with seed = 1
data(cadpc)
data(cadpc)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 6640 rows and 72 columns.
Cached ADPP data generated with seed = 1
data(cadpp)
data(cadpp)
An object of class data.frame
with 26268 rows and 68 columns.
Cached ADQLQC data generated with seed = 1
data(cadqlqc)
data(cadqlqc)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 116803 rows and 50 columns.
Cached ADQS data generated with seed = 1
data(cadqs)
data(cadqs)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 14000 rows and 73 columns.
Cached ADRS data generated with seed = 1
data(cadrs)
data(cadrs)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3200 rows and 65 columns.
Cached ADSL data generated with seed = 1
data(cadsl)
data(cadsl)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 400 rows and 55 columns.
Cached ADSUB data generated with seed = 1
data(cadsub)
data(cadsub)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 2000 rows and 65 columns.
Cached ADTR data generated with seed = 1
data(cadtr)
data(cadtr)
An object of class data.frame
with 2800 rows and 76 columns.
Cached ADTTE data generated with seed = 1
data(cadtte)
data(cadtte)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 2000 rows and 67 columns.
Cached ADVS data generated with seed = 1
data(cadvs)
data(cadvs)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 16800 rows and 87 columns.
Replace column values with NA
s.
mutate_na(ds, na_vars = NULL, na_percentage = 0.05)
mutate_na(ds, na_vars = NULL, na_percentage = 0.05)
ds |
( |
na_vars |
(
|
na_percentage |
( |
dataframe without NA
values.
Function for generating a random Anti-Drug Antibody Analysis Dataset for a given Subject-Level Analysis Dataset and Pharmacokinetics Analysis Dataset.
radab( adsl, adpc, constants = c(D = 100, ka = 0.8, ke = 1), paramcd = c("R1800000", "RESULT1", "R1800001", "RESULT2", "ADASTAT1", "INDUCD1", "ENHANC1", "TRUNAFF1", "EMERNEG1", "EMERPOS1", "PERSADA1", "TRANADA1", "BFLAG1", "TIMADA1", "ADADUR1", "ADASTAT2", "INDUCD2", "ENHANC2", "EMERNEG2", "EMERPOS2", "BFLAG2", "TRUNAFF2"), param = c("Antibody titer units", "ADA interpreted per sample result", "Neutralizing Antibody titer units", "NAB interpreted per sample result", "ADA Status of a patient", "Treatment induced ADA", "Treatment enhanced ADA", "Treatment unaffected", "Treatment Emergent - Negative", "Treatment Emergent - Positive", "Persistent ADA", "Transient ADA", "Baseline", "Time to onset of ADA", "ADA Duration", "NAB Status of a patient", "Treatment induced ADA, Neutralizing Antibody", "Treatment enhanced ADA, Neutralizing Antibody", "Treatment Emergent - Negative, Neutralizing Antibody", "Treatment Emergent - Positive, Neutralizing Antibody", "Baseline, Neutralizing Antibody", "Treatment unaffected, Neutralizing Antibody"), avalu = c("titer", "", "titer", "", "", "", "", "", "", "", "", "", "", "weeks", "weeks", "", "", "", "", "", "", ""), seed = NULL, na_percentage = 0, na_vars = list(AVAL = c(NA, 0.1)), cached = FALSE )
radab( adsl, adpc, constants = c(D = 100, ka = 0.8, ke = 1), paramcd = c("R1800000", "RESULT1", "R1800001", "RESULT2", "ADASTAT1", "INDUCD1", "ENHANC1", "TRUNAFF1", "EMERNEG1", "EMERPOS1", "PERSADA1", "TRANADA1", "BFLAG1", "TIMADA1", "ADADUR1", "ADASTAT2", "INDUCD2", "ENHANC2", "EMERNEG2", "EMERPOS2", "BFLAG2", "TRUNAFF2"), param = c("Antibody titer units", "ADA interpreted per sample result", "Neutralizing Antibody titer units", "NAB interpreted per sample result", "ADA Status of a patient", "Treatment induced ADA", "Treatment enhanced ADA", "Treatment unaffected", "Treatment Emergent - Negative", "Treatment Emergent - Positive", "Persistent ADA", "Transient ADA", "Baseline", "Time to onset of ADA", "ADA Duration", "NAB Status of a patient", "Treatment induced ADA, Neutralizing Antibody", "Treatment enhanced ADA, Neutralizing Antibody", "Treatment Emergent - Negative, Neutralizing Antibody", "Treatment Emergent - Positive, Neutralizing Antibody", "Baseline, Neutralizing Antibody", "Treatment unaffected, Neutralizing Antibody"), avalu = c("titer", "", "titer", "", "", "", "", "", "", "", "", "", "", "weeks", "weeks", "", "", "", "", "", "", ""), seed = NULL, na_percentage = 0, na_vars = list(AVAL = c(NA, 0.1)), cached = FALSE )
adsl |
( |
adpc |
( |
constants |
( |
paramcd |
( |
param |
( |
avalu |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADAB data |
One record per study per subject per parameter per time point: "R1800000", "RESULT1", "R1800001", "RESULT2".
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adpc <- radpc(adsl, seed = 2, duration = 9 * 7) adab <- radab(adsl, adpc, seed = 2) adab
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adpc <- radpc(adsl, seed = 2, duration = 9 * 7) adab <- radab(adsl, adpc, seed = 2) adab
Function for generating random Adverse Event Analysis Dataset for a given Subject-Level Analysis Dataset.
radae( adsl, max_n_aes = 10L, lookup = NULL, lookup_aag = NULL, seed = NULL, na_percentage = 0, na_vars = list(AEBODSYS = c(NA, 0.1), AEDECOD = c(1234, 0.1), AETOXGR = c(1234, 0.1)), cached = FALSE )
radae( adsl, max_n_aes = 10L, lookup = NULL, lookup_aag = NULL, seed = NULL, na_percentage = 0, na_vars = list(AEBODSYS = c(NA, 0.1), AEDECOD = c(1234, 0.1), AETOXGR = c(1234, 0.1)), cached = FALSE )
adsl |
( |
max_n_aes |
( |
lookup |
( |
lookup_aag |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADAE data |
One record per each record in the corresponding SDTM domain.
Keys: STUDYID
, USUBJID
, ASTDTM
, AETERM
, AESEQ
data.frame
adsl <- radsl(N = 10, study_duration = 2, seed = 1) adae <- radae(adsl, seed = 2) adae # Add metadata. aag <- utils::read.table( sep = ",", header = TRUE, text = paste( "NAMVAR,SRCVAR,GRPTYPE,REFNAME,REFTERM,SCOPE", "CQ01NAM,AEDECOD,CUSTOM,D.2.1.5.3/A.1.1.1.1 AESI,dcd D.2.1.5.3,", "CQ01NAM,AEDECOD,CUSTOM,D.2.1.5.3/A.1.1.1.1 AESI,dcd A.1.1.1.1,", "SMQ01NAM,AEDECOD,SMQ,C.1.1.1.3/B.2.2.3.1 AESI,dcd C.1.1.1.3,BROAD", "SMQ01NAM,AEDECOD,SMQ,C.1.1.1.3/B.2.2.3.1 AESI,dcd B.2.2.3.1,BROAD", "SMQ02NAM,AEDECOD,SMQ,Y.9.9.9.9/Z.9.9.9.9 AESI,dcd Y.9.9.9.9,NARROW", "SMQ02NAM,AEDECOD,SMQ,Y.9.9.9.9/Z.9.9.9.9 AESI,dcd Z.9.9.9.9,NARROW", sep = "\n" ), stringsAsFactors = FALSE ) adae <- radae(adsl, lookup_aag = aag) with( adae, cbind( table(AEDECOD, SMQ01NAM), table(AEDECOD, CQ01NAM) ) )
adsl <- radsl(N = 10, study_duration = 2, seed = 1) adae <- radae(adsl, seed = 2) adae # Add metadata. aag <- utils::read.table( sep = ",", header = TRUE, text = paste( "NAMVAR,SRCVAR,GRPTYPE,REFNAME,REFTERM,SCOPE", "CQ01NAM,AEDECOD,CUSTOM,D.2.1.5.3/A.1.1.1.1 AESI,dcd D.2.1.5.3,", "CQ01NAM,AEDECOD,CUSTOM,D.2.1.5.3/A.1.1.1.1 AESI,dcd A.1.1.1.1,", "SMQ01NAM,AEDECOD,SMQ,C.1.1.1.3/B.2.2.3.1 AESI,dcd C.1.1.1.3,BROAD", "SMQ01NAM,AEDECOD,SMQ,C.1.1.1.3/B.2.2.3.1 AESI,dcd B.2.2.3.1,BROAD", "SMQ02NAM,AEDECOD,SMQ,Y.9.9.9.9/Z.9.9.9.9 AESI,dcd Y.9.9.9.9,NARROW", "SMQ02NAM,AEDECOD,SMQ,Y.9.9.9.9/Z.9.9.9.9 AESI,dcd Z.9.9.9.9,NARROW", sep = "\n" ), stringsAsFactors = FALSE ) adae <- radae(adsl, lookup_aag = aag) with( adae, cbind( table(AEDECOD, SMQ01NAM), table(AEDECOD, CQ01NAM) ) )
Function to generate random Time-to-AE Dataset for a given Subject-Level Analysis Dataset.
radaette( adsl, event_descr = NULL, censor_descr = NULL, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(CNSR = c(NA, 0.1), AVAL = c(1234, 0.1)), cached = FALSE )
radaette( adsl, event_descr = NULL, censor_descr = NULL, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(CNSR = c(NA, 0.1), AVAL = c(1234, 0.1)), cached = FALSE )
adsl |
( |
event_descr |
( |
censor_descr |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADAETTE data |
Keys: STUDYID
, USUBJID
, PARAMCD
data.frame
Xiuting Mi
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adaette <- radaette(adsl, seed = 2) adaette
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adaette <- radaette(adsl, seed = 2) adaette
Function for generating random Concomitant Medication Analysis Dataset for a given Subject-Level Analysis Dataset.
radcm( adsl, max_n_cms = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(CMCLAS = c(NA, 0.1), CMDECOD = c(1234, 0.1), ATIREL = c(1234, 0.1)), who_coding = FALSE, cached = FALSE )
radcm( adsl, max_n_cms = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(CMCLAS = c(NA, 0.1), CMDECOD = c(1234, 0.1), ATIREL = c(1234, 0.1)), who_coding = FALSE, cached = FALSE )
adsl |
( |
max_n_cms |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
who_coding |
( |
cached |
boolean whether the cached ADCM data |
One record per each record in the corresponding SDTM domain.
Keys: STUDYID
, USUBJID
, ASTDTM
, CMSEQ
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adcm <- radcm(adsl, seed = 2) adcm adcm_who <- radcm(adsl, seed = 2, who_coding = TRUE) adcm_who
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adcm <- radcm(adsl, seed = 2) adcm adcm_who <- radcm(adsl, seed = 2, who_coding = TRUE) adcm_who
Function for generating random Protocol Deviations Analysis Dataset for a given Subject-Level Analysis Dataset.
raddv( adsl, max_n_dv = 3L, p_dv = 0.15, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(ASTDT = c(seed = 1234, percentage = 0.1), DVCAT = c(seed = 1234, percentage = 0.1)), cached = FALSE )
raddv( adsl, max_n_dv = 3L, p_dv = 0.15, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(ASTDT = c(seed = 1234, percentage = 0.1), DVCAT = c(seed = 1234, percentage = 0.1)), cached = FALSE )
adsl |
( |
max_n_dv |
( |
p_dv |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADDV data |
One record per each record in the corresponding SDTM domain.
Keys: STUDYID
, USUBJID
, ASTDT
, DVTERM
, DVSEQ
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) addv <- raddv(adsl, seed = 2) addv
adsl <- radsl(N = 10, seed = 1, study_duration = 2) addv <- raddv(adsl, seed = 2) addv
Function for generating random dataset from ECG Analysis Dataset for a given Subject-Level Analysis Dataset.
radeg( adsl, egcat = c("INTERVAL", "INTERVAL", "MEASUREMENT", "FINDING"), param = c("QT Duration", "RR Duration", "Heart Rate", "ECG Interpretation"), paramcd = c("QT", "RR", "HR", "ECGINTP"), paramu = c("msec", "msec", "beats/min", ""), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, max_n_eg = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(ABLFL = c(1235, 0.1), BASE = c(NA, 0.1), BASEC = c(NA, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1)), cached = FALSE )
radeg( adsl, egcat = c("INTERVAL", "INTERVAL", "MEASUREMENT", "FINDING"), param = c("QT Duration", "RR Duration", "Heart Rate", "ECG Interpretation"), paramcd = c("QT", "RR", "HR", "ECGINTP"), paramu = c("msec", "msec", "beats/min", ""), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, max_n_eg = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(ABLFL = c(1235, 0.1), BASE = c(NA, 0.1), BASEC = c(NA, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1)), cached = FALSE )
adsl |
( |
egcat |
( |
param |
( |
paramcd |
( |
paramu |
( |
visit_format |
( |
n_assessments |
( |
n_days |
( |
max_n_eg |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADEG data |
One record per subject per parameter per analysis visit per analysis date.
Keys: STUDYID
, USUBJID
, PARAMCD
, BASETYPE
, AVISITN
, ATPTN
, DTYPE
, ADTM
, EGSEQ
, ASPID
data.frame
tomlinsj, npaszty, Xuefeng Hou, dipietrc
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adeg <- radeg(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) adeg adeg <- radeg(adsl, visit_format = "CYCLE", n_assessments = 2L, seed = 2) adeg
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adeg <- radeg(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) adeg adeg <- radeg(adsl, visit_format = "CYCLE", n_assessments = 2L, seed = 2) adeg
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 )
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 )
adsl |
( |
param |
( |
paramcd |
( |
paramu |
( |
parcat1 |
( |
parcat2 |
( |
visit_format |
( |
n_assessments |
( |
n_days |
( |
max_n_exs |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADEX data |
One record per each record in the corresponding SDTM domain.
Keys: STUDYID
, USUBJID
, EXSEQ
, PARAMCD
, PARCAT1
, ASTDTM
, AENDTM
, ASTDY
, AENDY
,
AVISITN
, EXDOSFRQ
, EXROUTE
, VISIT
, VISITDY
, EXSTDTC
, EXENDTC
, EXSTDY
, EXENDY
data.frame
adsl <- radsl(N = 10, study_duration = 2, seed = 1) adex <- radex(adsl, seed = 2) adex
adsl <- radsl(N = 10, study_duration = 2, seed = 1) adex <- radex(adsl, seed = 2) adex
Function for generating a random Hy's Law Analysis Dataset for a given Subject-Level Analysis Dataset.
radhy( adsl, param = c("TBILI <= 2 times ULN and ALT value category", "TBILI > 2 times ULN and AST value category", "TBILI > 2 times ULN and ALT value category", "TBILI <= 2 times ULN and AST value category", "TBILI > 2 times ULN and ALKPH <= 2 times ULN and ALT value category", "TBILI > 2 times ULN and ALKPH <= 2 times ULN and AST value category", "TBILI > 2 times ULN and ALKPH <= 5 times ULN and ALT value category", "TBILI > 2 times ULN and ALKPH <= 5 times ULN and AST value category", "TBILI <= 2 times ULN and two consecutive elevations of ALT in relation to ULN", "TBILI > 2 times ULN and two consecutive elevations of AST in relation to ULN", "TBILI <= 2 times ULN and two consecutive elevations of AST in relation to ULN", "TBILI > 2 times ULN and two consecutive elevations of ALT in relation to ULN", "TBILI > 2 times ULN and two consecutive elevations of ALT in relation to Baseline", "TBILI <= 2 times ULN and two consecutive elevations of ALT in relation to Baseline", "TBILI > 2 times ULN and two consecutive elevations of AST in relation to Baseline", "TBILI <= 2 times ULN and two consecutive elevations of AST in relation to Baseline", "ALT > 3 times ULN by Period", "AST > 3 times ULN by Period", "ALT or AST > 3 times ULN by Period", "ALT > 3 times Baseline by Period", "AST > 3 times Baseline by Period", "ALT or AST > 3 times Baseline by Period"), paramcd = c("BLAL", "BGAS", "BGAL", "BLAS", "BA2AL", "BA2AS", "BA5AL", "BA5AS", "BL2AL2CU", "BG2AS2CU", "BL2AS2CU", "BG2AL2CU", "BG2AL2CB", "BL2AL2CB", "BG2AS2CB", "BL2AS2CB", "ALTPULN", "ASTPULN", "ALTASTPU", "ALTPBASE", "ASTPBASE", "ALTASTPB"), seed = NULL, cached = FALSE )
radhy( adsl, param = c("TBILI <= 2 times ULN and ALT value category", "TBILI > 2 times ULN and AST value category", "TBILI > 2 times ULN and ALT value category", "TBILI <= 2 times ULN and AST value category", "TBILI > 2 times ULN and ALKPH <= 2 times ULN and ALT value category", "TBILI > 2 times ULN and ALKPH <= 2 times ULN and AST value category", "TBILI > 2 times ULN and ALKPH <= 5 times ULN and ALT value category", "TBILI > 2 times ULN and ALKPH <= 5 times ULN and AST value category", "TBILI <= 2 times ULN and two consecutive elevations of ALT in relation to ULN", "TBILI > 2 times ULN and two consecutive elevations of AST in relation to ULN", "TBILI <= 2 times ULN and two consecutive elevations of AST in relation to ULN", "TBILI > 2 times ULN and two consecutive elevations of ALT in relation to ULN", "TBILI > 2 times ULN and two consecutive elevations of ALT in relation to Baseline", "TBILI <= 2 times ULN and two consecutive elevations of ALT in relation to Baseline", "TBILI > 2 times ULN and two consecutive elevations of AST in relation to Baseline", "TBILI <= 2 times ULN and two consecutive elevations of AST in relation to Baseline", "ALT > 3 times ULN by Period", "AST > 3 times ULN by Period", "ALT or AST > 3 times ULN by Period", "ALT > 3 times Baseline by Period", "AST > 3 times Baseline by Period", "ALT or AST > 3 times Baseline by Period"), paramcd = c("BLAL", "BGAS", "BGAL", "BLAS", "BA2AL", "BA2AS", "BA5AL", "BA5AS", "BL2AL2CU", "BG2AS2CU", "BL2AS2CU", "BG2AL2CU", "BG2AL2CB", "BL2AL2CB", "BG2AS2CB", "BL2AS2CB", "ALTPULN", "ASTPULN", "ALTASTPU", "ALTPBASE", "ASTPBASE", "ALTASTPB"), seed = NULL, cached = FALSE )
adsl |
( |
param |
( |
paramcd |
( |
seed |
( |
cached |
boolean whether the cached ADHY data |
One record per subject per parameter per analysis visit per analysis date.
Keys: STUDYID
, USUBJID
, PARAMCD
, AVISITN
, ADTM
, SRCSEQ
data.frame
wojciakw
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adhy <- radhy(adsl, seed = 2) adhy
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adhy <- radhy(adsl, seed = 2) adhy
Function for generating a random Laboratory Data Analysis Dataset for a given Subject-Level Analysis Dataset.
radlb( adsl, lbcat = c("CHEMISTRY", "CHEMISTRY", "IMMUNOLOGY"), param = c("Alanine Aminotransferase Measurement", "C-Reactive Protein Measurement", "Immunoglobulin A Measurement"), paramcd = c("ALT", "CRP", "IGA"), paramu = c("U/L", "mg/L", "g/L"), aval_mean = c(18, 9, 2.9), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, max_n_lbs = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(LOQFL = c(NA, 0.1), ABLFL2 = c(1234, 0.1), ABLFL = c(1235, 0.1), BASE2 = c(NA, 0.1), BASE = c(NA, 0.1), CHG2 = c(1235, 0.1), PCHG2 = c(1235, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1)), cached = FALSE )
radlb( adsl, lbcat = c("CHEMISTRY", "CHEMISTRY", "IMMUNOLOGY"), param = c("Alanine Aminotransferase Measurement", "C-Reactive Protein Measurement", "Immunoglobulin A Measurement"), paramcd = c("ALT", "CRP", "IGA"), paramu = c("U/L", "mg/L", "g/L"), aval_mean = c(18, 9, 2.9), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, max_n_lbs = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(LOQFL = c(NA, 0.1), ABLFL2 = c(1234, 0.1), ABLFL = c(1235, 0.1), BASE2 = c(NA, 0.1), BASE = c(NA, 0.1), CHG2 = c(1235, 0.1), PCHG2 = c(1235, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1)), cached = FALSE )
adsl |
( |
lbcat |
( |
param |
( |
paramcd |
( |
paramu |
( |
aval_mean |
( |
visit_format |
( |
n_assessments |
( |
n_days |
( |
max_n_lbs |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADLB data |
One record per subject per parameter per analysis visit per analysis date.
Keys: STUDYID
, USUBJID
, PARAMCD
, BASETYPE
, AVISITN
, ATPTN
, DTYPE
, ADTM
, LBSEQ
, ASPID
data.frame
tomlinsj, npaszty, Xuefeng Hou
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adlb <- radlb(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) adlb adlb <- radlb(adsl, visit_format = "CYCLE", n_assessments = 2L, seed = 2) adlb
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adlb <- radlb(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) adlb adlb <- radlb(adsl, visit_format = "CYCLE", n_assessments = 2L, seed = 2) adlb
Function for generating a random Medical History Analysis Dataset for a given Subject-Level Analysis Dataset.
radmh( adsl, max_n_mhs = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(MHBODSYS = c(NA, 0.1), MHDECOD = c(1234, 0.1)), cached = FALSE )
radmh( adsl, max_n_mhs = 10L, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(MHBODSYS = c(NA, 0.1), MHDECOD = c(1234, 0.1)), cached = FALSE )
adsl |
( |
max_n_mhs |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADMH data |
One record per each record in the corresponding SDTM domain.
Keys: STUDYID
, USUBJID
, ASTDTM
, MHSEQ
data.frame
adsl <- radsl(N = 10, study_duration = 2, seed = 1) admh <- radmh(adsl, seed = 2) admh
adsl <- radsl(N = 10, study_duration = 2, seed = 1) admh <- radmh(adsl, seed = 2) admh
Function for generating a random Pharmacokinetics Analysis Dataset for a given Subject-Level Analysis Dataset.
radpc( adsl, avalu = "ug/mL", constants = c(D = 100, ka = 0.8, ke = 1), duration = 2, seed = NULL, na_percentage = 0, na_vars = list(AVAL = c(NA, 0.1)), cached = FALSE )
radpc( adsl, avalu = "ug/mL", constants = c(D = 100, ka = 0.8, ke = 1), duration = 2, seed = NULL, na_percentage = 0, na_vars = list(AVAL = c(NA, 0.1)), cached = FALSE )
adsl |
( |
avalu |
( |
constants |
( |
duration |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADPC data |
One record per study, subject, parameter, and time point.
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adpc <- radpc(adsl, seed = 2) adpc adpc <- radpc(adsl, seed = 2, duration = 3) adpc
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adpc <- radpc(adsl, seed = 2) adpc adpc <- radpc(adsl, seed = 2, duration = 3) adpc
Function for generating a random Pharmacokinetics Parameters Dataset for a given Subject-Level Analysis Dataset.
radpp( adsl, ppcat = c("Plasma Drug X", "Plasma Drug Y", "Metabolite Drug X", "Metabolite Drug Y"), ppspec = c("Plasma", "Plasma", "Plasma", "Matrix of PD", "Matrix of PD", "Urine", "Urine", "Urine", "Urine"), paramcd = c("AUCIFO", "CMAX", "CLO", "RMAX", "TON", "RENALCL", "RENALCLD", "RCAMINT", "RCPCINT"), param = c("AUC Infinity Obs", "Max Conc", "Total CL Obs", "Time of Maximum Response", "Time to Onset", "Renal CL", "Renal CL Norm by Dose", "Amt Rec from T1 to T2", "Pct Rec from T1 to T2"), paramu = c("day*ug/mL", "ug/mL", "ml/day/kg", "hr", "hr", "L/hr", "L/hr/mg", "mg", "%"), aval_mean = c(200, 30, 5, 10, 3, 0.05, 0.005, 1.5613, 15.65), visit_format = "CYCLE", n_days = 2L, seed = NULL, na_percentage = 0, na_vars = list(AVAL = c(NA, 0.1)), cached = FALSE )
radpp( adsl, ppcat = c("Plasma Drug X", "Plasma Drug Y", "Metabolite Drug X", "Metabolite Drug Y"), ppspec = c("Plasma", "Plasma", "Plasma", "Matrix of PD", "Matrix of PD", "Urine", "Urine", "Urine", "Urine"), paramcd = c("AUCIFO", "CMAX", "CLO", "RMAX", "TON", "RENALCL", "RENALCLD", "RCAMINT", "RCPCINT"), param = c("AUC Infinity Obs", "Max Conc", "Total CL Obs", "Time of Maximum Response", "Time to Onset", "Renal CL", "Renal CL Norm by Dose", "Amt Rec from T1 to T2", "Pct Rec from T1 to T2"), paramu = c("day*ug/mL", "ug/mL", "ml/day/kg", "hr", "hr", "L/hr", "L/hr/mg", "mg", "%"), aval_mean = c(200, 30, 5, 10, 3, 0.05, 0.005, 1.5613, 15.65), visit_format = "CYCLE", n_days = 2L, seed = NULL, na_percentage = 0, na_vars = list(AVAL = c(NA, 0.1)), cached = FALSE )
adsl |
( |
ppcat |
( |
ppspec |
( |
paramcd |
( |
param |
( |
paramu |
( |
aval_mean |
( |
visit_format |
( |
n_days |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADPP data |
One record per study, subject, parameter category, parameter and visit.
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adpp <- radpp(adsl, seed = 2) adpp
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adpp <- radpp(adsl, seed = 2) adpp
Function for generating a random EORTC QLQ-C30 V3 Analysis Dataset for a given Subject-Level Analysis Dataset.
radqlqc(adsl, percent, number, seed = NULL, cached = FALSE)
radqlqc(adsl, percent, number, seed = NULL, cached = FALSE)
adsl |
( |
percent |
( |
number |
( |
seed |
( |
cached |
boolean whether the cached ADQLQC data |
Keys: STUDYID
, USUBJID
, PARCAT1N
, PARAMCD
, BASETYPE
, AVISITN
, ATPTN
, ADTM
, QSSEQ
data.frame
adsl <- radsl(N = 10, study_duration = 2, seed = 1) adqlqc <- radqlqc(adsl, seed = 1, percent = 80, number = 2) adqlqc
adsl <- radsl(N = 10, study_duration = 2, seed = 1) adqlqc <- radqlqc(adsl, seed = 1, percent = 80, number = 2) adqlqc
Function for generating a random Questionnaires Analysis Dataset for a given Subject-Level Analysis Dataset.
radqs( adsl, param = c("BFI All Questions", "Fatigue Interference", "Function/Well-Being (GF1,GF3,GF7)", "Treatment Side Effects (GP2,C5,GP5)", "FKSI-19 All Questions"), paramcd = c("BFIALL", "FATIGI", "FKSI-FWB", "FKSI-TSE", "FKSIALL"), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, seed = NULL, na_percentage = 0, na_vars = list(LOQFL = c(NA, 0.1), ABLFL2 = c(1234, 0.1), ABLFL = c(1235, 0.1), CHG2 = c(1235, 0.1), PCHG2 = c(1235, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1)), cached = FALSE )
radqs( adsl, param = c("BFI All Questions", "Fatigue Interference", "Function/Well-Being (GF1,GF3,GF7)", "Treatment Side Effects (GP2,C5,GP5)", "FKSI-19 All Questions"), paramcd = c("BFIALL", "FATIGI", "FKSI-FWB", "FKSI-TSE", "FKSIALL"), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, seed = NULL, na_percentage = 0, na_vars = list(LOQFL = c(NA, 0.1), ABLFL2 = c(1234, 0.1), ABLFL = c(1235, 0.1), CHG2 = c(1235, 0.1), PCHG2 = c(1235, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1)), cached = FALSE )
adsl |
( |
param |
( |
paramcd |
( |
visit_format |
( |
n_assessments |
( |
n_days |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADQS data |
One record per subject per parameter per analysis visit per analysis date.
Keys: STUDYID
, USUBJID
, PARAMCD
, AVISITN
data.frame
npaszty
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adqs <- radqs(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) adqs adqs <- radqs(adsl, visit_format = "CYCLE", n_assessments = 3L, seed = 2) adqs
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adqs <- radqs(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) adqs adqs <- radqs(adsl, visit_format = "CYCLE", n_assessments = 3L, seed = 2) adqs
Function for generating a random Tumor Response Analysis Dataset for a given Subject-Level Analysis Dataset.
radrs( adsl, avalc = NULL, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(AVISIT = c(NA, 0.1), AVAL = c(1234, 0.1), AVALC = c(1234, 0.1)), cached = FALSE )
radrs( adsl, avalc = NULL, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(AVISIT = c(NA, 0.1), AVAL = c(1234, 0.1), AVALC = c(1234, 0.1)), cached = FALSE )
adsl |
( |
avalc |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADRS data |
One record per subject per parameter per analysis visit per analysis date. SDTM variables are populated on new records coming from other single records. Otherwise, SDTM variables are left blank.
Keys: STUDYID
, USUBJID
, PARAMCD
, AVISITN
, ADT
, RSSEQ
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adrs <- radrs(adsl, seed = 2) adrs
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adrs <- radrs(adsl, seed = 2) adrs
Function to generate random Time-to-Safety Event Dataset for a given Subject-Level Analysis Dataset.
radsaftte(adsl, ...)
radsaftte(adsl, ...)
adsl |
( |
... |
Additional arguments to be passed to |
Keys: STUDYID
, USUBJID
, PARAMCD
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adsaftte <- radsaftte(adsl, seed = 2) adsaftte
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adsaftte <- radsaftte(adsl, seed = 2) adsaftte
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.
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 )
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 )
N |
( |
study_duration |
( |
seed |
( |
with_trt02 |
( |
na_percentage |
( |
na_vars |
(
|
ae_withdrawal_prob |
( |
cached |
boolean whether the cached ADSL data |
One record per subject.
Keys: STUDYID
, USUBJID
data.frame
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
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
Function for generating a random Subcategory Analysis Dataset for a given Subject-Level Analysis Dataset.
radsub( adsl, param = c("Baseline Weight", "Baseline Height", "Baseline BMI", "Baseline ECOG", "Baseline Biomarker Mutation"), paramcd = c("BWGHTSI", "BHGHTSI", "BBMISI", "BECOG", "BBMRKR1"), seed = NULL, na_percentage = 0, na_vars = list(), cached = FALSE )
radsub( adsl, param = c("Baseline Weight", "Baseline Height", "Baseline BMI", "Baseline ECOG", "Baseline Biomarker Mutation"), paramcd = c("BWGHTSI", "BHGHTSI", "BBMISI", "BECOG", "BBMRKR1"), seed = NULL, na_percentage = 0, na_vars = list(), cached = FALSE )
adsl |
( |
param |
( |
paramcd |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADSUB data |
One record per subject.
Keys: STUDYID
, USUBJID
, PARAMCD
, AVISITN
, ADTM
, SRCSEQ
data.frame
tomlinsj, npaszty, Xuefeng Hou, dipietrc
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adsub <- radsub(adsl, seed = 2) adsub
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adsub <- radsub(adsl, seed = 2) adsub
Function for generating a random Tumor Response Analysis Dataset for a given Subject-Level Analysis Dataset.
radtr( adsl, param = c("Sum of Longest Diameter by Investigator"), paramcd = c("SLDINV"), seed = NULL, cached = FALSE, ... )
radtr( adsl, param = c("Sum of Longest Diameter by Investigator"), paramcd = c("SLDINV"), seed = NULL, cached = FALSE, ... )
adsl |
( |
param |
( |
paramcd |
( |
seed |
( |
cached |
boolean whether the cached ADTR data |
... |
Additional arguments to be passed to |
One record per subject per parameter per analysis visit per analysis date.
Keys: STUDYID
, USUBJID
, PARAMCD
, BASETYPE
, AVISITN
, DTYPE
data.frame
tomlinsj, npaszty, Xuefeng Hou, dipietrc
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adtr <- radtr(adsl, seed = 2) adtr
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adtr <- radtr(adsl, seed = 2) adtr
Function for generating a random Time-to-Event Analysis Dataset for a given Subject-Level Analysis Dataset.
radtte( adsl, event_descr = NULL, censor_descr = NULL, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(CNSR = c(NA, 0.1), AVAL = c(1234, 0.1), AVALU = c(1234, 0.1)), cached = FALSE )
radtte( adsl, event_descr = NULL, censor_descr = NULL, lookup = NULL, seed = NULL, na_percentage = 0, na_vars = list(CNSR = c(NA, 0.1), AVAL = c(1234, 0.1), AVALU = c(1234, 0.1)), cached = FALSE )
adsl |
( |
event_descr |
( |
censor_descr |
( |
lookup |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADTTE data |
Keys: STUDYID
, USUBJID
, PARAMCD
data.frame
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adtte <- radtte(adsl, seed = 2) adtte
adsl <- radsl(N = 10, seed = 1, study_duration = 2) adtte <- radtte(adsl, seed = 2) adtte
Function for generating a random Vital Signs Analysis Dataset for a given Subject-Level Analysis Dataset.
radvs( adsl, param = c("Diastolic Blood Pressure", "Pulse Rate", "Respiratory Rate", "Systolic Blood Pressure", "Temperature", "Weight"), paramcd = c("DIABP", "PULSE", "RESP", "SYSBP", "TEMP", "WEIGHT"), paramu = c("Pa", "beats/min", "breaths/min", "Pa", "C", "Kg"), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, seed = NULL, na_percentage = 0, na_vars = list(CHG2 = c(1235, 0.1), PCHG2 = c(1235, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1), AVAL = c(123, 0.1), AVALU = c(123, 0.1)), cached = FALSE )
radvs( adsl, param = c("Diastolic Blood Pressure", "Pulse Rate", "Respiratory Rate", "Systolic Blood Pressure", "Temperature", "Weight"), paramcd = c("DIABP", "PULSE", "RESP", "SYSBP", "TEMP", "WEIGHT"), paramu = c("Pa", "beats/min", "breaths/min", "Pa", "C", "Kg"), visit_format = "WEEK", n_assessments = 5L, n_days = 5L, seed = NULL, na_percentage = 0, na_vars = list(CHG2 = c(1235, 0.1), PCHG2 = c(1235, 0.1), CHG = c(1234, 0.1), PCHG = c(1234, 0.1), AVAL = c(123, 0.1), AVALU = c(123, 0.1)), cached = FALSE )
adsl |
( |
param |
( |
paramcd |
( |
paramu |
( |
visit_format |
( |
n_assessments |
( |
n_days |
( |
seed |
( |
na_percentage |
( |
na_vars |
(
|
cached |
boolean whether the cached ADVS data |
One record per subject per parameter per analysis visit per analysis date.
Keys: STUDYID
, USUBJID
, PARAMCD
, BASETYPE
, AVISITN
, ATPTN
, DTYPE
, ADTM
, VSSEQ
, ASPID
data.frame
npaszty
adsl <- radsl(N = 10, seed = 1, study_duration = 2) advs <- radvs(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) advs advs <- radvs(adsl, visit_format = "CYCLE", n_assessments = 3L, seed = 2) advs
adsl <- radsl(N = 10, seed = 1, study_duration = 2) advs <- radvs(adsl, visit_format = "WEEK", n_assessments = 7L, seed = 2) advs advs <- radvs(adsl, visit_format = "CYCLE", n_assessments = 3L, seed = 2) advs
Assign values to a related variable within a domain.
rel_var(df, var_name, related_var, var_values = NULL)
rel_var(df, var_name, related_var, var_values = NULL)
df |
( |
var_name |
( |
related_var |
( |
var_values |
( |
df
with added factor variable var_name
containing var_values
corresponding to related_var
.
# Example with data.frame. params <- c("Level A", "Level B", "Level C") adlb_df <- data.frame( ID = 1:9, PARAM = factor( rep(c("Level A", "Level B", "Level C"), 3), levels = params ) ) rel_var( df = adlb_df, var_name = "PARAMCD", var_values = c("A", "B", "C"), related_var = "PARAM" ) # Example with tibble. adlb_tbl <- tibble::tibble( ID = 1:9, PARAM = factor( rep(c("Level A", "Level B", "Level C"), 3), levels = params ) ) rel_var( df = adlb_tbl, var_name = "PARAMCD", var_values = c("A", "B", "C"), related_var = "PARAM" )
# Example with data.frame. params <- c("Level A", "Level B", "Level C") adlb_df <- data.frame( ID = 1:9, PARAM = factor( rep(c("Level A", "Level B", "Level C"), 3), levels = params ) ) rel_var( df = adlb_df, var_name = "PARAMCD", var_values = c("A", "B", "C"), related_var = "PARAM" ) # Example with tibble. adlb_tbl <- tibble::tibble( ID = 1:9, PARAM = factor( rep(c("Level A", "Level B", "Level C"), 3), levels = params ) ) rel_var( df = adlb_tbl, var_name = "PARAMCD", var_values = c("A", "B", "C"), related_var = "PARAM" )
Randomized replacement of values by NA
.
replace_na(v, percentage = 0.05, seed = NULL)
replace_na(v, percentage = 0.05, seed = NULL)
v |
( |
percentage |
( |
seed |
( |
The input vector v
where a certain number of values are replaced by NA
.
This generates random numbers from a truncated Exponential distribution,
i.e. from X | X > l
or X | X < r
when X ~ Exp(rate)
. The advantage here is that
we guarantee to return exactly n
numbers and without using a loop internally.
This can be derived from the quantile functions of the left- and right-truncated
Exponential distributions.
rtexp(n, rate, l = NULL, r = NULL)
rtexp(n, rate, l = NULL, r = NULL)
n |
( |
rate |
( |
l |
( |
r |
( |
The random numbers. If neither l
nor r
are provided then the usual Exponential
distribution is used.
x <- stats::rexp(1e6, rate = 5) x <- x[x > 0.5] hist(x) y <- rtexp(1e6, rate = 5, l = 0.5) hist(y) z <- rtexp(1e6, rate = 5, r = 0.5) hist(z)
x <- stats::rexp(1e6, rate = 5) x <- x[x > 0.5] hist(x) y <- rtexp(1e6, rate = 5, l = 0.5) hist(y) z <- rtexp(1e6, rate = 5, r = 0.5) hist(z)
This generates random numbers from a zero-truncated Poisson distribution,
i.e. from X | X > 0
when X ~ Poisson(lambda)
. The advantage here is that
we guarantee to return exactly n
numbers and without using a loop internally.
This solution was provided in a post by
Peter Dalgaard.
rtpois(n, lambda)
rtpois(n, lambda)
n |
( |
lambda |
( |
The random numbers.
x <- rpois(1e6, lambda = 5) x <- x[x > 0] hist(x) y <- rtpois(1e6, lambda = 5) hist(y)
x <- rpois(1e6, lambda = 5) x <- x[x > 0] hist(x) y <- rtpois(1e6, lambda = 5) hist(y)
Sample elements from x
with replacement to build a factor.
sample_fct(x, N, ...)
sample_fct(x, N, ...)
x |
( |
N |
( |
... |
Additional arguments to be passed to |
A factor of length N
.
sample_fct(letters[1:3], 10) sample_fct(iris$Species, 10)
sample_fct(letters[1:3], 10) sample_fct(iris$Species, 10)
Relabel a subset of variables in a data set.
var_relabel(x, ...)
var_relabel(x, ...)
x |
( |
... |
( |
x (data.frame
)
Data frame with labels applied.
adsl <- radsl() var_relabel(adsl, STUDYID = "Study Identifier", USUBJID = "Unique Subject Identifier" )
adsl <- radsl() var_relabel(adsl, STUDYID = "Study Identifier", USUBJID = "Unique Subject Identifier" )
Create a visit schedule as a factor.
visit_schedule(visit_format = "WEEK", n_assessments = 10L, n_days = 5L)
visit_schedule(visit_format = "WEEK", n_assessments = 10L, n_days = 5L)
visit_format |
( |
n_assessments |
( |
n_days |
( |
X number of visits, or X number of cycles and Y number of days.
A factor of length n_assessments
.
visit_schedule(visit_format = "WEeK", n_assessments = 10L) visit_schedule(visit_format = "CyCLE", n_assessments = 5L, n_days = 2L)
visit_schedule(visit_format = "WEeK", n_assessments = 10L) visit_schedule(visit_format = "CyCLE", n_assessments = 5L, n_days = 2L)