Helper Functions for Constructing ADQLQC
h_adqlqc.Rd
Internal functions used by radqlqc
.
Usage
get_qs_data(
adsl,
visit_format = "CYCLE",
n_assessments = 5L,
n_days = 1L,
lookup = NULL,
seed = NULL,
na_percentage = 0,
na_vars = list(QSORRES = c(1234, 0.2), QSSTRESC = c(1234, 0.2))
)
get_random_dates_between(from, to, visit_id)
prep_adqlqc(df)
calc_scales(adqlqc1)
derv_chgcat1(dataset)
comp_derv(dataset, percent, number)
Arguments
- adsl
(
data.frame
)
Subject-Level Analysis Dataset (ADSL).- visit_format
(
character
)
Type of visit. Options are "WEEK" and "CYCLE".- n_assessments
(
integer
)
Number of weeks or cycles.- n_days
(
integer
)
Number of days in each cycle (only used ifvisit_format
is "CYCLE").- lookup
(
data.frame
)
Additional parameters.- seed
(
numeric
)
Seed to use for reproducible random number generation.- na_percentage
(
proportion
)
Default percentage of values to be replaced byNA
.- na_vars
(
list
)
A named list where the name of each element is a column name ofds
. Each element of this list should be a numeric vector with two elements:seed
(numeric
)
The seed to be used for this element - can beNA
.percentage
(proportion
)
Percentage of elements to be replaced withNA
. IfNA
,na_percentage
is used as a default.
- from
(
datetime vector
)
Start date/times.- to
(
datetime vector
)
End date/times.- visit_id
(
vector
)
Visit identifiers.- df
(
data.frame
)
SDTM QS dataset.- adqlqc1
(
data.frame
)
Prepared data generated from theprep_adqlqc()
function.- dataset
(
data.frame
)
Dataset.- percent
(
numeric
)
Completion - Completed at least y percent of questions, 1 record per visit- number
(
numeric
)
Completion - Completed at least x question(s), 1 record per visit
Value
a dataframe with SDTM questionnaire data
Data frame with new randomly generated dates variable.
data.frame
data.frame
data.frame
data.frame
Functions
get_qs_data()
: Questionnaires EORTC QLQ-C30 V3.0 SDTM (QS)Function for generating random Questionnaires SDTM domain
get_random_dates_between()
: Function for generating random dates between 2 datesprep_adqlqc()
: Prepare ADaM ADQLQC data, adding PARAMCD to SDTM QS datacalc_scales()
: Scale calculation for ADQLQC dataderv_chgcat1()
: Calculate Change from Baseline Category 1comp_derv()
: Completion/Compliance Data Calculation
Examples
adsl <- radsl(N = 10, study_duration = 2, seed = 1)
adqlqc <- radqlqc(adsl, seed = 1, percent = 80, number = 2)
if (FALSE) {
qs <- random.cdisc.data:::get_qs_data(adsl, n_assessments = 5L, seed = 1, na_percentage = 0.1)
qs
}
if (FALSE) {
df <- dplyr::left_join(
adsl,
qs,
by = c("STUDYID", "USUBJID"),
multiple = "all"
) |>
dplyr::mutate(
AVISIT = VISIT,
PARAMCD = QSTESTCD,
AVISITN = VISITNUM
) |>
dplyr::mutate(ADTM = random.cdisc.data:::get_random_dates_between(TRTSDTM, TRTEDTM, AVISITN))
df
}
if (FALSE) {
adqlqc1 <- random.cdisc.data:::prep_adqlqc(df = qs)
adqlqc1
}
if (FALSE) {
df_scales <- random.cdisc.data:::calc_scales(df)
df_scales
}
if (FALSE) {
adqlqc <- random.cdisc.data:::derv_chgcat1(dataset = adqlqc |> dplyr::select(-CHGCAT1))
adqlqc
}
if (FALSE) {
compliance_data <- random.cdisc.data:::comp_derv(adqlqc, 80, 2)
compliance_data
}