Purpose
This function allows to create and run several Monolix projects implementing linear (with and without delay) and non-linear (Emax, Emax with sigmoidicity, loglinear) mixed effect model to analyze conc-QTc data.
Details
The function takes as input as dataset as generated by the process_QTcData() function. The dataset must contains the following columns with mandatory headers: "QT", "QTc", "dQTc", "HR", "dHR", "BLQTc_cent", "Cc_reg", "RR_reg", as well as "BLQTc_centAdjPl", "ddQTc" and "ddHR" in case of ΔΔQTc and "TIME_cat" in case of predose baseline. Columns for the id, time and drug concentration are also needed but can have custom headers.
First, the data formatting module of Monolix is used to convert the dataset from a wide to a long format, by merging the QT, QTc, dQTc, ddQTc, HR, dHR, ddHR columns and create a corresponding OBSID column. Occasions column to distinguish several periods within the same individual are also created based on the TRT column and optionally the columns indicated as additional variables.
Then several Monolix projects are created corresponding to the standard model described in the Garnett. et al white paper, either for ΔQTc or ΔΔQTc, as well as alternative models: Emax, Emax with sigmoidicity (Hill function), loglinear and linear with a delay via an effect compartment. The shape of the conc-QTc relationship is defined via the structural model files, which are taken from the library of the package. With the provided library, 5 Monolix projects are created. The model also contains an intercept parameter, on which the other variables of the model are added as covariates.
For ΔQTc, the covariates are BLQTc_cent (centered QTc baseline), TRT (active vs placebo, if placebo data available), TIME_cat (nominal time as factor, if predose baseline) and additional variables if specified. For ΔΔQTc, they are BLQTc_centAdjPl (placebo-adjusted centered baseline QTc) and additional variables if specified.
Additional column can be indicated as stratification covariates. They will not be used for the modeling itself, but can be used to stratify plots and tables in the report.
The initial parameter values are initialized to meaningful values and algorithm settings are customized to speed up the parameter estimation. Finally, the generated Monolix projects are run. The different models will be compared in the report generation step.
Arguments
-
dataSet (character): the path to a dataset in csv, txt or xlsx format. Mandatory
-
IDname (character): column name for subject ID. Mandatory
-
TIMEname (character): column name for nominal time points (in hr units). Mandatory
-
TRTname (character): column name for treatment group (e.g placebo versus drug). Optional if no placebo, mandatory otherwise
-
CONCname (character): column name for drug concentration (any units). Mandatory
-
placeboName (character): a string specifying the name of the placebo group. If missing, the placebo group will be inferred from the values of the TRTname column. If the dataset does not contain placebo, use "no placebo". Optional
-
baselineType (character): a string specifying the baseline type, among ‘predose’ (default) or ‘time-matched’. Determines the presence of the TIME as categorical covariate in the model. Optional
-
addVariables (vector of characters): additional columns to be used as categorical factors in the conc-QTc model (e.g “day”). Optional
-
refCategory (vector of characters): the reference category for each of the additional variables. If missing, the first category is alphabetical order will be used as reference. Optional
-
addStratCatCov (character): additional column to be used for stratification purpose in the report generation. Optional
-
modelFolder (character): the path to the folder containing the library of pre-written models. Mandatory
-
projectFolder (character): folder in which the generated Monolix projects will be saved. Mandatory
-
isddQTC (logical): if ‘false’ (default), the modeled variable is ΔQTc, otherwise it is ΔΔQTc. Optional
-
bRun (logical): if ‘true’ (default), the generated Monolix projects are run. Optional
-
silent (logical): if ‘false’ (default), the model equation and run status are printed to the R console. Optional
Examples
Example 1
This example allows to generate Monolix projects based on the dataSet="processed_data.csv". In order to analyze ΔQTc, we set isddQTC = F. In addition, the folder containing the ΔQTc models is indicated with modelFolder = "../_mlxQTcTools/models/dQTcModels". The Monolix projects are not only generated but also run using bRun = T.
generateQTcProject(
dataSet = "processed_data.csv",
IDname = "USUBJID",
TIMEname = "TSLD",
TRTname = "TRT",
CONCname = "CONC",
placeboName = "Placebo",
baselineType = "predose",
modelFolder = "../_mlxQTcTools/models/dQTcModels",
projectFolder = "./projects",
isddQTC = F,
bRun = T,
silent = F
)
Example 2
In order to analyze ΔΔQTc instead of ΔQTc, we can set isddQTC = T and select the model folder modelFolder = "../_mlxQTcTools/models/ddQTcModels".
generateQTcProject(
dataSet = "processed_data.csv",
IDname = "USUBJID",
TIMEname = "TSLD",
TRTname = "TRT",
CONCname = "CONC",
placeboName = "Placebo",
baselineType = "predose",
modelFolder = "../_mlxQTcTools/models/ddQTcModels",
projectFolder = "./projects",
isddQTC = T,
bRun = T,
silent = F
)
Example 3
In case of a dataset without placebo data, the TRT factor should not appear in the model. This can be indicated with placeboName = "no placebo" and/or with TRTname = NULL. If time-matched baselines have been recorded, the TIME factor should not appear in the model. This is specified with baselineType = "time-matched".
generateQTcProject(
dataSet = "processed_data.csv",
IDname = "USUBJID",
TIMEname = "TSLD",
TRTname = NULL,
placeboName = "no placebo",
CONCname = "CONC",
baselineType = "time-matched",
modelFolder = "../_mlxQTcTools/models/dQTcModels",
projectFolder = "./projects",
isddQTC = F,
bRun = T,
silent = F
)
Example 4
In addition to the standard factors, it is possible to include additional categorical variables. This is in particular useful when the data has been collected over several days and we want to include both nominal time within the day and the day. To specify additional variables we use addVariables = c("DAY"). Note that several additional variables can be listed. By default, for the additional variable, the first category in alphabetical order is considered as the reference, and all other categories have a corresponding factor in the model. To indicate a different reference category (for instance the first day), we use refCategory = c("Day 1"). In addition to the variables used in the model, it is possible to define stratification variables which will be used later for plot and table stratification in the report, using addStratCatCov = "DayGroup".
generateQTcProject(
dataSet = "processed_data.csv",
IDname = "USUBJID",
TIMEname = "TIME",
TRTname = "TRT",
CONCname = "CONC",
placeboName = "Placebo",
baselineType = "predose",
addVariables = c("DAY"),
refCategory = c("Day 1"),
addStratCatCov = "DayGroup",
modelFolder = "../_mlxQTcTools/models/dQTcModels",
projectFolder = "./projects",
isddQTC = F,
bRun = T,
silent = F
)