4 Examples

IQnca contains a range of examples that are included in the examples folder of the installed library. The folder can be conveniently copied to another directory by the function examples_IQnca. The default path to which the example material is copied is ~/IntiQuan/IQnca. Note that the working directory is also changed to this directory.

examples_IQnca(path = "~/IntiQuan/IQnca")
## IQnca documentation example material copied to: ~/IntiQuan/IQnca
## Working directory set to: ~/IntiQuan/IQnca
Table 4.1: Examples included in IQnca
Folder Subfolder Example
01_simple_linuplogdn 01_Indo_Lin_Bolus
02_Indo_Lin_Infusion
03_Ind_Lin_EV_wrong
05_Ind_Log_Bolus
06_Ind_Log_Infusion
07_Indo_Log_EV_wrong
08_Theoph_Linear
09_Theoph_Log
02_additional 01_LinUpLogDn 01_Extravascular
02_Extravascular_Repeat_Dose
03_Extravascular_Single_Dose
04_IV_Bolus_Single_Dose
05_IV_Inf_SD
02_Mixed 01_Extravascular_Single_Dose
02_EV_SD_Interp
03_Lin_LinInterp 04_IV_Bolus_Single_Dose
03_book_examples Example_1 figures
Example_2
Example_3 output

The following examples showcase some of the features the IQnca package has to offer. For each individual example, the data contains a different combination of administration and profile type, and also the AUC calculation method varies.

  • Example 1 is a simple introductory analysis, using the “Extravascular_Repeat_Dose” data.
  • Example 2 shows listings, tables and figures, using the “IV_Bolus_Single_Dose” data.
  • Example 3 handles LLOQ values, using the, using the “IV_Infusion_Single_Dose” data.

4.1 Example 1

The first example is a simple case study of an analysis. The dataset used is an intravascular bolus single dose data which can be found in examples/03_book_examples/Example_1/IV_Bolus_Single_Dose.xls. The data stems from a study X where the drug A was administered intravascularly to a group of 4 subjects. The drug was given as a 10000 ug bolus dose. The given time unit is “Minutes”, the dosing unit is “ug” and the concentration was measured in “ng/mL”. In this analysis the NCA parameters are calculated by an AUC determined is calculated in a linear manner on increasing parts of the concentration curve and in a logarithmic manner on decreasing parts of the curve. Additionally, the AUCs of the time intervals [0,6] and [0,12] are calculated.

4.1.1 Original data

As a first step, import the source dataset:

dataFile <- "examples/03_book_examples/Example_1/IV_Bolus_Single_Dose.xls"
dataOrig <- readxl::read_excel(dataFile)

The contents of this dataset (15 first rows) are shown below.

Table 4.2: First 15 rows of the dataset
Time Conc Subject Dose
min ug/L NA ug
10 920 1 10000
20 800 1 10000
30 750 1 10000
40 630 1 10000
50 610 1 10000
60 530 1 10000
70 520 1 10000
90 380 1 10000
110 350 1 10000
150 200 1 10000
10 850 2 10000
20 630 2 10000
30 580 2 10000
40 1020 2 10000
## The first row of the data set contains no relevant data
## and therefore needs to be removed
dataOrig <- dataOrig[-1,]
## Number of subjects
length(unique(dataOrig$Subject))
## [1] 4
## Number of dosing groups
length(unique(dataOrig$Dose))
## [1] 1

The IQdataNCA function is used to create an IQdataNCA object which is a dataframe. A preliminary step is to modify the original dataset according to the IQnca specification. The names of existing relevant columns need to be mapped to column names given by the specification. Furthermore, required columns which are missing from the dataset need to be added manually, provided such information exists. Table 3.1 (or calling dataSpec_IQdataNCA()) gives information on the necessary columns to build a minimally functioning example. Columns in the original dataset which do not have a counterpart in the specification may simply be ignored.

## Renaming columns of the original dataset and adding additional information
data <- data.frame(
  USUBJID = dataOrig$Subject,
  STUDYID = "Study X",
  COMPOUND = "Drug A",
  ANALYTE = "Drug A",
  MATRIX = "Plasma",
  PROFILE = "Single Bolus Dose (SD)",
  PROFTYPE = "SD",
  GROUP = "10000 ug",
  GROUPN = 10000,
  GROUPU = "ug",
  DAY = NA,
  ATIME = NA,
  NTIME = as.numeric(dataOrig$Time),
  TIMEUNIT = "Minutes",
  ACONC = as.numeric(dataOrig$Conc),
  CONCUNIT = "ng/mL",
  LLOQ = 0, # Faking LLOQ
  ADM = "Bolus",
  DOSE = as.numeric(dataOrig$Dose),
  DOSEUNIT = "ug",
  stringsAsFactors = FALSE
)

In this example the columns ID,TIME,CONC,DOSE from the source dataset were mapped to USUBJID,NTIME,ACONC,DOSE.

Table 4.3: First five rows of the minimally required dataset
USUBJID STUDYID COMPOUND ANALYTE MATRIX PROFILE PROFTYPE GROUP GROUPN GROUPU DAY ATIME NTIME TIMEUNIT ACONC CONCUNIT LLOQ ADM DOSE DOSEUNIT
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug NA NA 10 Minutes 920 ng/mL 0 Bolus 10000 ug
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug NA NA 20 Minutes 800 ng/mL 0 Bolus 10000 ug
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug NA NA 30 Minutes 750 ng/mL 0 Bolus 10000 ug
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug NA NA 40 Minutes 630 ng/mL 0 Bolus 10000 ug
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug NA NA 50 Minutes 610 ng/mL 0 Bolus 10000 ug

4.1.2 IQdataNCA object

The function IQdataNCA gives the user the ability to make individual choices about the AUC calculation method, the interpolation method and the handling of records with concentration values below the lower limit of quantification. In this example the AUC on increasing parts of the concentration curve is calculated by the linear trapezoidal method, and for decreasing parts the logarithmic trapezoidal rule is used (see section 6.6). Similarly, interpolation on increasing parts is done by linear rule and on decreasing parts by logarithmic rule. By setting the parameter FLAGTIME as “nominal” the TIME data from the original dataset is taken as nominal time. Furthermore, by giving a character string of intervals in the parameter AUCINVAL, the AUC on those intervals may be returned. For more detailed information about the functionality of IQdataNCA refer to chapter 5. An example of special handling of blloq values is shown in Example 2.

dataNCA <- IQdataNCA(data, FLAGTIME = "nominal",
                                      AUCMETHD = "LinearUp LogDown", AUCINVAL = "[0;6];[0;12]")
Table 4.4: First five rows of the IQdataNCA object.
USUBJID STUDYID COMPOUND ANALYTE MATRIX PROFILE PROFTYPE GROUP GROUPN GROUPU DAY ATIME NTIME TIMEUNIT ACONC CONCUNIT LLOQ ADM DOSE DOSEUNIT TAU ADUR NDUR VISIT VISITNUM PCTPT PCDTC EXSTDTC PERIOD SEQUENCE COUNTRY SITEID AGE SEX RACE IX COMPTYPE IGNOREI IGNORER IGNORSUM IGNORNCA COMMENTR COMMENTI ATAFD NTAFD FLAGTIME FATIMIMP TAFD TIME DUR BLLOQ BLLOQPR BLLOQIN BLLOQP1 BLLOQPO FLGBLQPR FLGBLQIN FLGBLQP1 FLGBLQPO FGBQPLIN FGBQPLOG CONC CONCPLIN CONCPLOG FLGSLOPE SLOPETOL SLOPEPT R2 R2ADJ LAMZNPT LAMZ LAMZICPT CORRXY LAMZLL LAMZUL CLSTP AUCMETHD AUCINVAL
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug . . 10 MINUTES 920 ng/mL 0 BOLUS 10000 ug . . . . . . . . . . . . . . . 1 exogenous . . . . . . . 10 nominal asis 10 10 . 0 0 0 0 0 0 missing lloq/2 missing asconc asconc 920 920 920 bestslope 1e-04 1 0.9887083 0.9872969 10 0.0104409 6.918914 -0.9943381 10 150 211.1941 linearup logdown [0;6];[0;12]
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug . . 20 MINUTES 800 ng/mL 0 BOLUS 10000 ug . . . . . . . . . . . . . . . 2 exogenous . . . . . . . 20 nominal asis 20 20 . 0 0 0 0 0 0 missing lloq/2 missing asconc asconc 800 800 800 bestslope 1e-04 1 0.9887083 0.9872969 10 0.0104409 6.918914 -0.9943381 10 150 211.1941 linearup logdown [0;6];[0;12]
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug . . 30 MINUTES 750 ng/mL 0 BOLUS 10000 ug . . . . . . . . . . . . . . . 3 exogenous . . . . . . . 30 nominal asis 30 30 . 0 0 0 0 0 0 missing lloq/2 missing asconc asconc 750 750 750 bestslope 1e-04 1 0.9887083 0.9872969 10 0.0104409 6.918914 -0.9943381 10 150 211.1941 linearup logdown [0;6];[0;12]
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug . . 40 MINUTES 630 ng/mL 0 BOLUS 10000 ug . . . . . . . . . . . . . . . 4 exogenous . . . . . . . 40 nominal asis 40 40 . 0 0 0 0 0 0 missing lloq/2 missing asconc asconc 630 630 630 bestslope 1e-04 1 0.9887083 0.9872969 10 0.0104409 6.918914 -0.9943381 10 150 211.1941 linearup logdown [0;6];[0;12]
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug . . 50 MINUTES 610 ng/mL 0 BOLUS 10000 ug . . . . . . . . . . . . . . . 5 exogenous . . . . . . . 50 nominal asis 50 50 . 0 0 0 0 0 0 missing lloq/2 missing asconc asconc 610 610 610 bestslope 1e-04 1 0.9887083 0.9872969 10 0.0104409 6.918914 -0.9943381 10 150 211.1941 linearup logdown [0;6];[0;12]

A first exploratory look into the data can be made by using the plot.IQdataNCA function. This plotting function is best used for data exploration; for reporting a different function is used. Individual plots show the individual profiles in different panels. The observation points are overlaid with labels, indicating the number of the sample (column IX in the IQdataNCA object). These plots allow to assess potential outliers and to select points that should be considered for slope calculation (if manual selection is desired). Plots are produced both on a linear and log Y axis.

plot(dataNCA, logY = TRUE, filename = "examples/03_book_examples/Example_1/figures/plot_1.pdf")

Individual concentration curves of each subject, with y-axis log10 scaled

4.1.2.1 Data cleaning

By the visualisation of the data it is revealed that Subject 2 possesses an implausible outlier. The plot enumerates each record by the column IX which simplifies the removal of the outlier.

dataNCA <- dataNCA[-which(dataNCA$USUBJID == "2" & dataNCA$IX == 4),]
plot(dataNCA[dataNCA$USUBJID == "2",], logY = TRUE, nindiv = 1, filename = "examples/03_book_examples/Example_1/figures/plot_1_subject2.pdf")

Concentration curve of Subject 2, outlier removed, with y-axis log10 scaled

4.1.2.2 Manual slope selection

The terminal slope for each subject is initially calculated by the best-slope algorithm. The slope parameters are automatically included in the IQdataNCA dataset.

# The slope parameters in the first row of "dataNCA", corresponding to Subject 1
dataNCA[1,c("FLGSLOPE","SLOPEPT","R2","R2ADJ","LAMZNPT","LAMZ","LAMZICPT","CORRXY","LAMZLL","LAMZUL","CLSTP")]
Table 4.5: Slope parameters of Subject 1, best-slope algorithm
FLGSLOPE SLOPETOL SLOPEPT R2 R2ADJ LAMZNPT LAMZ LAMZICPT CORRXY LAMZLL LAMZUL CLSTP
bestslope 1e-04 1 0.9887083 0.9872969 10 0.0104409 6.918914 -0.9943381 10 150 211.1941

In this example the slope points for the first subject will be manually selected and the manual slope calculation is previewed with slopetest_IQnca.

# Terminal slope by manually choosing the records 5,7,8,9,10 of Subject 1
slopetest_IQnca(data = dataNCA,USUBJID = "1",IXslope = c(5,7:10))
## Determining slope based on provided points in IXslope

The slope parameters with the desired slope points are then recalculated in the IQdataNCA object by the slope_IQdataNCA function.

# slope_manual_NCA generates list entries. One list entry per subject, in this example there is only a single subject
manualslope <- list(slope_manual_NCA(USUBJID = "1",IXslope = c(5,7:10)))
# Recalculate the slope parameters and include them in the IQdataNCA object
dataNCA <- slope_IQdataNCA(data = dataNCA, manualslope = manualslope)

The new slope parameters for Subject 1:

dataNCA[1,c("FLGSLOPE","SLOPEPT","R2","R2ADJ","LAMZNPT","LAMZ","LAMZICPT","CORRXY","LAMZLL","LAMZUL","CLSTP")]
Table 4.6: Slope parameters of Subject 1, manually selected slope
FLGSLOPE SLOPETOL SLOPEPT R2 R2ADJ LAMZNPT LAMZ LAMZICPT CORRXY LAMZLL LAMZUL CLSTP
manual 1e-04 0 0.982244 0.9763253 5 0.0110831 6.994555 -0.9910822 50 150 206.8693

A summary table can give greater insight into the data and the associated statistics by calling the IQdataNCA method summary.

summary(dataNCA)
##    Profile                | Number subjects | Number samples
##    ---------------------------------------------------------
##    Single Bolus Dose (SD) | 4               | 39

4.1.3 Parameter calculation and IQnca object

dataNCA is an IQdataNCA object which can be used for the NCA parameter calculation. It is the input for the function nca_IQdataNCA which calculates the NCA parameters.

paramNCA <- nca_IQdataNCA(dataNCA)
The output is an IQnca object which is a dataframe containing all calculated PK parameters.
Table 4.7: The NCA parameters for each of the subjects
USUBJID STUDYID COMPOUND ANALYTE MATRIX PROFILE PROFTYPE GROUP GROUPN GROUPU TIMEUNIT CONCUNIT LLOQ ADM DOSE DOSEUNIT TAU ADUR NDUR PERIOD SEQUENCE COUNTRY SITEID AGE SEX RACE COMPTYPE FLAGTIME FATIMIMP DUR FLGSLOPE SLOPETOL AUCMETHD AUCINVAL LAMZICPT CORRXY LAMZ LAMZNPT LAMZLL LAMZUL R2 R2ADJ LAMZHL SPAN TLAG C0 TMAX CMAX CMAXD TMIN CMIN CMIND TLST CLST CLSTP CAVG CTAU FLUCP FLUCPTAU AILAMZ SWING SWINGTAU AUCALL AUCIFO AUCIFOD AUCIFP AUCIFPD AUCLST AUCLSTD AUCPBEO AUCPBEP AUCPEO AUCPEP AUCTAU AUCTAUD CLFO CLFP CLFSS CLO CLP CLSS VSSO VSSP VZFO VZFP VZFSS VZO VZP VZSS AUMCIFO AUMCIFP AUMCLST AUMCPEO AUMCPEP AUMCTAU AUCPTAUE MRTEVIFO MRTEVIFP MRTEVLST MRTIVIFO MRTIVIFP MRTIVLST AUCINT1 AUCINT1D AUCINT2 AUCINT2D
1 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug MINUTES ng/mL 0 BOLUS 10000 ug NA NA NA NA NA NA NA NA NA NA exogenous nominal asis NA manual 1e-04 linearup logdown [0;6];[0;12] 6.994555 -0.9910822 0.0110831 5 50 150 0.9822440 0.9763253 62.54080 1.598956 NA 1058.0000 10 920 0.0920 150 200 0.0200 150 200 206.86930 NA NA NA NA NA NA NA 77174.24 95219.70 9.521970 95839.50 9.583950 77174.24 7.717424 10.369632 10.302571 18.951394 19.475539 NA NA NA NA NA 0.1050203 0.1043411 NA 9.582734 9.621291 NA NA NA 9.475697 9.414417 NA 8688465 8837358 4353453 49.89388 50.73807 NA NA NA NA NA 91.24651 92.20997 56.41070 6089.124 0.6089124 11688.454 1.1688454
2 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug MINUTES ng/mL 0 BOLUS 10000 ug NA NA NA NA NA NA NA NA NA NA exogenous nominal asis NA bestslope 1e-04 linearup logdown [0;6];[0;12] 6.952288 -0.9955550 0.0209562 9 10 150 0.9911298 0.9898626 33.07602 4.232674 NA 1146.8254 10 850 0.0850 150 42 0.0042 150 42 45.09903 NA NA NA NA NA NA NA 48500.64 50504.82 5.050482 50652.70 5.065270 48500.64 4.850064 19.622189 19.564901 3.968298 4.248664 NA NA NA NA NA 0.1980009 0.1974228 NA 9.361160 9.420541 NA NA NA 9.448328 9.420743 NA 2387785 2417024 1991521 16.59546 17.60441 NA NA NA NA NA 47.27837 47.71758 41.06176 6298.096 0.6298096 11560.235 1.1560235
3 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug MINUTES ng/mL 0 BOLUS 10000 ug NA NA NA NA NA NA NA NA NA NA exogenous nominal asis NA bestslope 1e-04 linearup logdown [0;6];[0;12] 6.877619 -0.9984467 0.0189195 10 10 150 0.9968957 0.9965077 36.63672 3.821303 NA 941.1765 10 800 0.0800 150 60 0.0060 150 60 56.80923 NA NA NA NA NA NA NA 48126.72 51298.06 5.129806 51129.41 5.112941 48126.72 4.812672 16.933918 16.989774 6.182177 5.872720 NA NA NA NA NA 0.1949392 0.1955822 NA 10.371467 10.309132 NA NA NA 10.303629 10.337616 NA 2729242 2695030 2085918 23.57151 22.60130 NA NA NA NA NA 53.20361 52.70998 43.34221 5380.468 0.5380468 10261.047 1.0261047
4 Study X Drug A Drug A Plasma Single Bolus Dose (SD) SD 10000 ug 10000 ug MINUTES ng/mL 0 BOLUS 10000 ug NA NA NA NA NA NA NA NA NA NA exogenous nominal asis NA bestslope 1e-04 linearup logdown [0;6];[0;12] 6.207537 -0.9971818 0.0096248 10 10 150 0.9943716 0.9936681 72.01703 1.943985 NA 540.5625 10 465 0.0465 150 120 0.0120 150 120 117.19292 NA NA NA NA NA NA NA 39568.22 52036.05 5.203605 51744.40 5.174440 39568.22 3.956822 9.643958 9.698315 23.959992 23.531400 NA NA NA NA NA 0.1921745 0.1932576 NA 20.028554 19.978403 NA NA NA 19.966660 20.079200 NA 5423233 5349183 2257667 58.37045 57.79416 NA NA NA NA NA 104.22069 103.37704 57.05760 3101.180 0.3101180 5934.471 0.5934471

Alternatively the IQnca object can displayed by calling the IQnca method print which is not shown here to avoid inflating the example.

4.2 Example 2

The dataset for the second example is an intravascular infusion single dose data which can be found in examples/03_book_examples/Example_2/IV_Infusion_Single_Dose.xls. The data stems from a study Y where the drug B was administered intravascularly by a single infusion dose with a dosing of 300 mg/m2 to 3 subjects and 400mg/m2 to 2 subjects. The given time unit is “Hours”, the dosing unit is “mg” and the concentration was measured in “ug/mL”. In this example the AUC is determined by using the linear trapezoidal method on the curve before Tmax and the logarithmic trapezoidal method for the part after Tmax. Possible interpolation is done by using the linear or logarithmic rule, on the respective parts of the curve.

dataFile <- "examples/03_book_examples/Example_2/IV_Infusion_Single_Dose.xls"
dataOrig <- readxl::read_excel(dataFile)

The contents of this dataset (15 first rows) are shown below.

Table 4.2: First 15 rows of the dataset
ID Dose Dose_1 Timepoint Actual_time Nominal_time Conc BSA Sex
NA mg_m2 mg NA h h ug/mL m2 NA
1 300 540 0 HR -1.8300000000000001 0 BLQ 1.8 Female
1 300 540 0.5 HR 0.57999999999999996 0.5 17.7 1.8 Female
1 300 540 Infusion End 1.9199999999999999 2 75.4 1.8 Female
1 300 540 8 HR 7.7999999999999998 8 64 1.8 Female
1 300 540 Day 1 25.25 24 55.2 1.8 Female
1 300 540 Day 2 49.079999999999998 48 49.1 1.8 Female
1 300 540 Day 3 76.280000000000001 72 42.3 1.8 Female
1 300 540 Wk 1 193.33000000000001 168 27.5 1.8 Female
1 300 540 Day 10 244.41999999999999 240 27.4 1.8 Female
1 300 540 Wk 2 358.10000000000002 336 21.3 1.8 Female
1 300 540 Wk 4 699.04999999999995 672 10.3 1.8 Female
1 300 540 0 HR 1055.4200000000001 0 7.1 1.8 Female
2 300 660 0 HR -2.1200000000000001 0 BLQ 2.2000000000000002 Male
2 300 660 0.5 HR 0.55000000000000004 0.5 33.3 2.2000000000000002 Male
## The first row of the dataset contains no relevant data
## and therefore needs to be removed
dataOrig <- dataOrig[-1,]
## Number of subjects
length(unique(dataOrig$ID))
## [1] 5
## Number of dosing groups
length(unique(dataOrig$Dose))
## [1] 2

Like in example 1, augment the original dataset according to the IQnca specification in the same manner and rename it to data (not shown here).

# Also add manually the actual duration of the infusion 
# which is not included in the dataset 
# (see the "Dosing_Used.xls" dataset in the same folder)
data$ADUR[data$USUBJID==1] <- 1.83
data$ADUR[data$USUBJID==2] <- 2.17
data$ADUR[data$USUBJID==3] <- 2.07
data$ADUR[data$USUBJID==4] <- 2.67
data$ADUR[data$USUBJID==5] <- 3.67
data$ADUR[data$USUBJID==6] <- 2.5
Table 4.8: First five rows of the augmented dataset
USUBJID STUDYID COMPOUND ANALYTE MATRIX PROFILE PROFTYPE GROUP GROUPN GROUPU DAY ATIME NTIME TIMEUNIT ACONC CONCUNIT LLOQ ADM DOSE DOSEUNIT NDUR ADUR SEX
1 Study Y Drug B Drug B Plasma Single IV Infusion Dose (SD) SD 300mg/m2 300 mg/m2 NA -1.83 0.0 Hours BLQ ug/mL 5 Infusion 540 mg 2 1.83 Female
1 Study Y Drug B Drug B Plasma Single IV Infusion Dose (SD) SD 300mg/m2 300 mg/m2 NA 0.58 0.5 Hours 17.7 ug/mL 5 Infusion 540 mg 2 1.83 Female
1 Study Y Drug B Drug B Plasma Single IV Infusion Dose (SD) SD 300mg/m2 300 mg/m2 NA 1.92 2.0 Hours 75.4 ug/mL 5 Infusion 540 mg 2 1.83 Female
1 Study Y Drug B Drug B Plasma Single IV Infusion Dose (SD) SD 300mg/m2 300 mg/m2 NA 7.80 8.0 Hours 64 ug/mL 5 Infusion 540 mg 2 1.83 Female
1 Study Y Drug B Drug B Plasma Single IV Infusion Dose (SD) SD 300mg/m2 300 mg/m2 NA 25.25 24.0 Hours 55.2 ug/mL 5 Infusion 540 mg 2 1.83 Female

4.2.1 BLQ data handling

The lower limit of quantification (LLOQ) in this example is 5 ug/mL. In the source dataset all concentrations lower than that are marked with “BLQ”, as can be seen in the table above. This needs to be amended before the IQdataNCA function is applied. Replace all such entries with a desired value smaller than the LLOQ.

  data$ACONC = {
    x <- data$ACONC
    x[grepl("BLQ",x)] <- 0
    as.numeric(x)
  }

The IQdataNCA function provides multiple options for handling LLOQ data. In this example, BLQ values before the first time above the LLOQ are set to LLOQ/2, BLQ values in the middle are left as is, and trailing BLQ values are set to zero. The chosen AUC calculation method is “Linear Log”.

dataNCA <- IQdataNCA(data, FLAGTIME = "nominal",
                                      AUCMETHD = "Linear Log", 
                     FLGBLQPR = "LLOQ/2", 
                     FLGBLQIN = "asis", 
                     FLGBLQP1 = "0", 
                     FLGBLQPO = "0")

Individual concentration curves of each subject

4.2.2 Data plots

IQdataNCA objects can be plotted in several ways. While the plot.IQdataNCA function is useful for data exploration, for reporting more sophisticated plotting functions are being used. The plots then are directly exported as PDF files for easier viewing.

4.2.2.1 Summary level plots

Summary level plots show the data in the same plots. Both on linear and log Y axis and both untransformed and dose-normalized. For each GROUP and PROFILE, a separate plot is created. In this example there are two dosing groups and a single profile. Stratification by various columns of the data is expressed by the coloring of the curves. In the following example the spaghetti plot is stratified by USUBJID.

## Create and save a spaghettiplot as pdf, log10 scaled y-axis, stratified by USUBJID (default)
figure_spaghetti_IQdataNCA(dataNCA, logY = TRUE, strat = "USUBJID", filename = "examples/03_book_examples/Example_2/figures/spaghetti_1.pdf")

The horizontal dashed line in the figure above marks the LLOQ. Another example, where we stratify by SEX, leaving the y-axis in original scale and dose-normalize the concentration.

## Create and save a spaghettiplot as pdf, stratified by SEX, dose-normalized
figure_spaghetti_dosenorm_IQdataNCA(dataNCA, logY = FALSE, strat = "SEX", filename = "examples/03_book_examples/Example_2/figures/spaghetti_2.pdf")

Spaghetti plot of the concentration data, stratified by SEX, dose-normalized

Note that the plots can be stratified by all categorical columns of the dataset, not just covariates. this is not certain –> ( The stratified columns can contain categorical or continuous data, but doing the latter is only recommended if there is a small finite number of unique values in the column. Obviously, the plots cannot be stratified by time and concentration.)

4.2.2.2 Individual plots

Individual plots show the individual profiles in different panels. Plots are produced both on a linear and log Y axis.

## Create and save individual plots as pdf, log10 scaled y-axis
figures_indiv_IQdataNCA(dataNCA, logY = TRUE, nindiv = 4, filename = "examples/03_book_examples/Example_2/figures/indiv_1.pdf")

Individual concentration curves of each subject, with y-axis log10 scaled

4.2.2.3 Mean plots

Mean plots show binned mean and geometric mean plots with and without standard errors on linear and log Y axis. For each group, defined by a different entry in the GROUP column, a line is plotted. Below, both mean and geometric mean plots are shown.

## A mean plot of the concentration
figure_summary_mean_IQdataNCA(dataNCA, logY = FALSE, filename = "examples/03_book_examples/Example_2/figures/figure_mean_1.pdf", USETAD = FALSE)

Mean plot of the concentration data, with upper standard deviation

## A mean plot of the concentration with log10 scaled y-axis
figure_summary_mean_IQdataNCA(dataNCA, logY = TRUE, filename = "examples/03_book_examples/Example_2/figures/figure_mean_2.pdf", USETAD = FALSE)

Mean plot of the concentration data, with log10 scaled y-axis, with upper standard deviation

## A geometric mean plot of the concentration.
figure_summary_geomean_IQdataNCA(dataNCA, logY = FALSE, filename = "examples/03_book_examples/Example_2/figures/figure_geommean_1.pdf")

Geometric mean plot of the concentration data, with upper geometric standard deviation

## A geometric mean plot of the concentration with log10 scaled y-axis
figure_summary_geomean_IQdataNCA(dataNCA, logY = TRUE, filename = "examples/03_book_examples/Example_2/figures/figure_geommean_2.pdf")

Geometric mean plot of the concentration data, with log10 scaled y-axis, with upper geometric standard deviation

4.3 Example 3

The pharmacokinetics of the drug candidate QWQ4242 following multiple doses were investigated in a single-arm study STD-0815. 10 mg of QWQ4242 was given once daily for one week to 10 healthy indiviuduals. PK profiles in plasma were monitored on Day 1 and after the last dose on Day 7. For Day 1, the profile was obtained for the dosing interval whereas the Day 7 profile monitored the washout up to one week after the last dose.

To investigate and compare the PK characteristics after first dose and at the assumed steady-state, an NCA is conducted for both profiles. The AUC is to be calculated based on linear trapezoidal rule before the maximum concentration and based on logatithmic trapezoidal rule afterwards. The standard settings for BLQ handling are applied.

The PK data is provided in the IQncaData input format, i.e., all required columns for importing the data as IQRdataNCA are prepared.

# Load input data set prepared for IQdataNCA import
dataInput <- IQRloadCSVdata("examples/03_book_examples/Example_3/std-0815_PKdataNCA.csv")
head(dataInput)
  USUBJID  STUDYID COMPOUND ANALYTE MATRIX    PROFILE PROFTYPE        GROUP
1       1 STD-0815  QWQ4242 QWQ4242 Plasma First dose       FD 10mg_OD_Oral
2       1 STD-0815  QWQ4242 QWQ4242 Plasma First dose       FD 10mg_OD_Oral
3       1 STD-0815  QWQ4242 QWQ4242 Plasma First dose       FD 10mg_OD_Oral
4       1 STD-0815  QWQ4242 QWQ4242 Plasma First dose       FD 10mg_OD_Oral
5       1 STD-0815  QWQ4242 QWQ4242 Plasma First dose       FD 10mg_OD_Oral
6       1 STD-0815  QWQ4242 QWQ4242 Plasma First dose       FD 10mg_OD_Oral
  GROUPN GROUPU DAY  ATIME  NTIME TIMEUNIT    ACONC CONCUNIT LLOQ           ADM
1     10     mg   1 0.0000 0.0000    Hours   0.3689    ng/mL    1 EXTRAVASCULAR
2     10     mg   1 0.1667 0.1667    Hours  24.2235    ng/mL    1 EXTRAVASCULAR
3     10     mg   1 1.0000 1.0000    Hours  74.1386    ng/mL    1 EXTRAVASCULAR
4     10     mg   1 2.0000 2.0000    Hours 134.2214    ng/mL    1 EXTRAVASCULAR
5     10     mg   1 4.0000 4.0000    Hours 131.8492    ng/mL    1 EXTRAVASCULAR
6     10     mg   1 8.0000 8.0000    Hours  75.9524    ng/mL    1 EXTRAVASCULAR
  DOSE DOSEUNIT TAU
1   10       mg  24
2   10       mg  24
3   10       mg  24
4   10       mg  24
5   10       mg  24
6   10       mg  24

Such, the input dataset can readily be imported by IQdataNCA for analysis preparation, i.e., defining the analysis setting in the data set. The summary function provides an overview over the number of subjects and observations for each profile. Here, the numbers reported are as expected.

# Import the data as IQdataNCA and implement default settings for the analysis
dataNCA <- IQdataNCA(dataInput, AUCMETHD = "Linear Log")

# Summary of dataNCA to display number of subjects and sampled per profile
summary(dataNCA)
   Profile           | Number subjects | Number samples
   ----------------------------------------------------
   First dose        | 10              | 90            
   Steady-state dose | 10              | 120           

The exploratory plots show the individual profiles. No obvious outlier is visible, but for subject 1 the slope for the steady-state profile with washout could not be determined precisely.

plot(dataNCA, filename = "examples/03_book_examples/Example_3/output/01_EDA.pdf")

Exploratory data plots

p <- lapply(7:10, function(kstart) {slopetest_IQnca(dataNCA, USUBJID = "1", PROFILE = "Steady-state dose", IXslope = kstart:12)})
## Determining slope based on provided points in IXslope
## Determining slope based on provided points in IXslope
## Determining slope based on provided points in IXslope
## Determining slope based on provided points in IXslope
IQRoutputPDF(p, filename = "examples/03_book_examples/Example_3/output/02_ManualSlopeTesting.pdf", nrow = 1, ncol = 2) 

Checking slope for steady-state profile of subject 1

As the exploratory data analysis indicates that

# Perform NCA analysis
resNCA <- nca_IQdataNCA(dataNCA)