Chapter 25

Non-Linear Regression Analysis of Individual Subject Data

return to the Course index
previous | next

Analysis using Non-linear Regression Programs

In this section I will briefly describe how to set up two non-linear regression programs, Boomer (https://www.boomer.org/boomer/) and Phoenix WinNonlin (https://www.certara.com/software/pkpd-modeling-and-simulation/phoenix-winnonlin/), which can be used in the analysis of pharmacokinetic data. Other useful pharmacokinetic data analysis programs are listed on this page.

Although graphical methods, such as we have used throughout this course, can be quite useful there are some significant limitations. A major limiting feature is that it must be possible to represent the data with a straight line. It may be possible to transform the data, for example by taking the log of the y value, but a straight line is still necessary. A problem with transforming the data is that the variance or error in each data point can be distorted inappropriately. It is fortunate that taking the log of the y-value (usually concentration) and performing a linear regression of ln(y-value) results in a reasonable representation of the variance. This is not generally the case as for example with ARE plots for urine data analysis.

Using non-linear regression analysis it is possible to assign a specific variance (or weight) to each data point that is appropriate for the measurement. Thus data that are very accurately known can be analysed with data that are less accurately known by assigning a higher weight to the better data. Generally a weight equal to the reciprocal of the variance is applied to the data.

Weight inversely proportional to variance

Equation 25.3.1 Ideally the Weight for each data point will be equal or proportional to the Variance of the Data Point

Another very useful feature of non-linear regression analysis is that we can fit more than one line simultaneously. For example we may give a drug to a subject and collect blood and urine samples at various times. The blood can be assayed for drug plasma concentration and the urine data can be assayed for excreted drug amounts. These data, with appropriate weights, can be analyzed together to give a comprehensive fit to the data.

Plasma and Urine Data

Figure 25.3.1 Plasma and Urine Data after IV Bolus Dose Administration

With non-linear regression analysis the shape of data curve doesn't matter. It can be a curve or straight line. There can be multiple lines (as above). The non-linear regression program simply adjusts the parameters of the model until the calculated line(s) best represents the data. Thus data collected during an IV infusion as well after the infusion has been stopped can be analyzed readily using non-linear regression analysis. Using graphical methods only the data after the infusion has finished could be easily analyzed.

Figure 25.3.2 Semi-log Plot of Cp versus time after a 2 hour IV Infusion

Program Set-Up - General approach

Model Visualization

The first step in the running a nonlinear regression problem is to visualize the model. The two factors which need to be considered are the route of drug administration and the data that has been collected. Designing the experiment and planning the samples involves identifiability and optimal sampling; here we are concerned with modeling data already collected.

From the route of administration the modeler can include details in the model that describe the administration. This might be single or multiple dose regimens. Drug may be given by IV bolus injection, IV infusion, or an extravascular route such as oral, topical or inhalation. The extravascular routes may include multiple steps such dissolution and absorption in the case of oral administration or diffusion from a patch and through the skin in the case of a topical dose. The structure of this part of the model may be derived from an understanding of the dosage form and prior knowledge however certain parameter values may need to be determined by nonlinear regression. Dissolution rate constants, multiple absorption rate constants, lag times and extent of absorption may be among the parameters to be estimated.

Consideration of the data plotted on linear and semi-log graph paper will provide more information about a suitable model. Distribution may be described with more than one compartment. More data types, such drug excreted in urine or metabolite concentrations, provide information useful in extending the model to better describe drug metabolism or excretion.

With some nonlinear programs it is possible to draw a sketch of a proposed models or select a pre-drawn model from a library (WinNonlin). Users of other programs such as Boomer may wish to draw this visualization by hand. Having a clear idea of what the model 'looks' like can be very useful in correctly defining the model with any nonlinear regression program.

Derive the Mathematical Model

A number of nonlinear regression program relieve the modeler from the chore of deriving the equations required to describe the pharmacokinetic model. These programs include Boomer and WinNONLIN, although further model definition is possible if the equations are known. ADAPT II users and users of WinNONLIN with models that go beyond the built-in library will need to use suitable equations to define the model. Differential equations can be derived directly from the model diagram. Integrated equation for most pharmacokinetic models can be derived using Laplace transforms. This method is discussed elsewhere in an introduction and more information.

Defining the Model within the Nonlinear Regression Program

Each program is somewhat different in the way one defines the model but there are three different approaches. Details of how models are define within any given program should be available within the program manual.

Selection from a library Some programs have a collection of predefined models within a library. The user simply selects the appropriate model from this library. WinNonlin is an example of this approach. It is probably the easiest for the user IF their model is in the library. JGuiB provides a GUI which allows the user to select a model for use with Boomer.

Selection of Model Parameters Programs like Boomer provide the user with a collection of parameters, rate constants, volumes, components (compartments) and many more to provide a toolbox from which the user can build their model. This provides the user with considerable flexibility without the need to derive the equations required for the model. If the parameter toolbox contains all the required parts this can be very convenient.

Describe the Model using Computer Code For maximum flexibility the modeler can describe their model using a computer language. WinNonlin provides this flexibility with the Phoenix Modeling Language (PML). Although this approach is flexible it does also require more coding experience from the modeler.

Program Set-up - An Example using Boomer

Analysis Type

 METHOD OF ANALYSIS

 0) Normal fitting
 1) Bayesian
 2) Simulation only
 3) Iterative Reweighted Least Squares
 4) Simulation with random error
 5) Grid Search
Non-linear regression analysis with a good number of data from one subject can be analyzed as a 'Normal Fitting'. A good number of data might be defined as twice the number of parameters to be estimated. The sampling site and sample timing should also be considered in designing the experiment.

Model Specification

With Boomer the model is defined by selecting appropriate parameters from the toolbox, the type of parameters available.

MODEL Definition and Parameter Entry       * Allowed Parameter Types *

 -5) read model         -3) display choices      -2) display parameters

  0) Time interrupt      1) Dose/initial amount   2) First order rate
  3) Zero order          4-5) Vm and Km of Michaelis-Menten
  6) Added constant      7) Kappa-Reciprocal volume
  8-10) C = a * EXP(-b * (X-c))
 11-13) Emax (Hill) Eq with Ec(50%) & S term     14) Second order rate
 15-17) Physiological Model Parameters (Q, V, and R)
 18) Apparent volume of distribution   19) Dummy parameter for double dependence
 20-22) C = a * SIN(2 * pi * (X - c)/b)

 Special Functions for First-order Rate Constants
 23-24) k = a * X + b                  25-27) k = a * EXP(-b * (X - c))
 28-30) k = a * SIN(2 * pi * (X - c)/b)
 31,32-33) dAt/dt = - k * V * Cf (Saturable Protein Binding)
 34-36) k * (1 - Imax * C/(IC(50%) + C)) Inhibition  0 or 1st order
 37-39) k * (1 + Smax * C/(SC(50%) + C)) Stimulation 0 or 1st order
 40) Uniform [-1 to 1] and 41) Normal [-3 to 3] Probability
 42) Switch parameter                  43) Clone component
 44-47) Four parameter logistic model  48-51) Four parameter Weibull model

Figure 25.3.3 Parameter types available with Boomer (v3.4.7 Mar 2022)

For example, for a one compartment model with a 2 hour infusion used to analyze the data shown above in Figure 25.3.2, the model can be drawn as shown below, Figure 25.3.4

Figure 25.3.4 Diagram Illustrating a One Compartment Model with an IV Infusion

This model is described in the Boomer output in tabular format. Notice the use of parameters type 2 and 18 for kel and V, respectively. The infusion rate, a type 3 parameter, is turned off ('Stop'ped) at the value (2 hr) of the Duration, a type 0 parameter.

 Model and Parameter Definition

  #  Name                    Value       Type From To     Dep  Start Stop

  1) kel                 =  0.9139E-01    2    1    0       0    0    0
  2) V                   =   13.47       18    1    1       0    0    0
  3) Duration            =   2.000        0    0    0       0    0    0
  4) k0                  =   100.0        3    0    1       0    0    1

Figure 25.3.5 The Model Included in the Boomer Output

Data and Weight Specification

The x and y values (Time and Concentration) for each data set (line) are entered from the keyboard or from a data file already stored on the computer hard-drive. A weight can then be assigned by equation or independently entered by the user.

 Weighting function entry for [Drug]

 0) Equal weights
 1) Weight by 1/Cp(i)
 2) Weight by 1/Cp(i)^2
 3) Weight by 1/a*Cp(i)^b
 4) Weight by 1/(a + b*Cp(i)^c)
 5) Weight by 1/((a+b*Cp(i)^c)*d^(tn-ti))

Figure 25.3.6 Choices of Weight Equation provided in Boomer

More detail regarding these weight equations can be found in the Boomer manual or online.

Program Output

After successful completion of the Boomer run a detailed output file will provide information about the fit to the data using the model and selected weighting scheme. This output file will provide tabular, statistical and graphical output which can aid the analyst in the interpretation of the results.

Tabular and Statistical

(Section 1)
 ** FINAL OUTPUT FROM Boomer (v3.1.5) **      25 July 2005 --- 10:52:41 am

 Title:  Fit to data before and after termination of an IV infusion
 Input: From Fig2202.BAT
 Output:  To Fig2202.OUT
 Data for [Drug]          came from keyboard (or ?.BAT)
 Fitting algorithm: DAMPING-GAUSS/SIMPLEX
 Weighting for [Drug]          by 1/Cp(Obs )^2
 Numerical integration method: 2) Fehlberg RKF45
          with  1 de(s)
 With relative error   0.1000E-03
 With absolute error   0.1000E-03
 DT =   0.1000E-02     PC =   0.1000E-04 Loops =     1
 Damping =     1

(Section 2)
                    ** FINAL PARAMETER VALUES ***

  #  Name                  Value       S.D.       C.V. %  Lower <-Limit-> Upper

  1) kel                   0.91394E-01  0.431E-02   4.7       0.0       1.0
  2) V                      13.473      0.618       4.6       1.0      0.10E+03

 Final WSS =   0.886379E-01 R^2 =   0.9671     Corr. Coeff =   0.9834
 AIC =   -17.8088     Log likelihood =   8.02     Schwartz Criteria =   -17.4143
 R and R^2 - jp1     0.9856        0.9714
 R and R^2 - jp2     0.9856        0.9714

(Section 3)
 Model and Parameter Definition

  #  Name                    Value       Type From To     Dep  Start Stop

  1) kel                 =  0.9139E-01    2    1    0       0    0    0
  2) V                   =   13.47       18    1    1       0    0    0
  3) Duration            =   2.000        0    0    0       0    0    0
  4) k0                  =   100.0        3    0    1       0    0    1

(Section 4)
 Data for [Drug]          :-

 DATA #   Time       Observed      Calculated    (Weight)  Weighted residual

     1    0.000       0.00000       0.00000       0.00000       0.00000
     2   0.5000       3.80000       3.62770      0.263158      0.453408E-01
     3    1.000       7.40000       7.09336      0.135135      0.414372E-01
     4    1.500       10.8000       10.4042      0.925926E-01  0.366464E-01
     5    2.000       0.00000       13.5672       0.00000       0.00000
     6    3.000       12.0000       12.3822      0.833333E-01 -0.318495E-01
     7    5.000       9.00000       10.3137      0.111111     -0.145965
     8    9.000       8.00000       7.15558      0.125000      0.105553
     9    12.00       5.00000       5.43962      0.200000     -0.879240E-01
    10    18.00       3.90000       3.14352      0.256410      0.193969
    11    24.00       1.70000       1.81662      0.588235     -0.686003E-01

     WSS for data set  1 =   0.8864E-01
               R^2 =   0.9671     Corr. Coeff. =   0.9834
 R and R^2 - jp1     0.9856        0.9714
 R and R^2 - jp2     0.9856        0.9714

 Maximum value for [Drug]          is      12.000     at       3.000

(Section 5)
 Calculation of AUC and AUMC based on trapezoidal rule

 AUC and AUMC for [Drug]          using Observed data

       Time         Concentration      AUC             AUMC

      0.00000    (     0.00000    )
     0.500000          3.80000        0.950000        0.475000
      1.00000          7.40000         3.75000         2.80000
      1.50000          10.8000         8.30000         8.70000
      2.00000          0.00000         11.0000         12.7500
      3.00000          12.0000         17.0000         30.7500
      5.00000          9.00000         38.0000         111.750
      9.00000          8.00000         72.0000         345.750
      12.0000          5.00000         91.5000         543.750
      18.0000          3.90000         118.200         934.350
      24.0000          1.70000         135.000         1267.35
                                       153.601         1917.29

 Secondary Parameters

MRT =      12.482

 Half-life values for each first order rate constant

   Parameter   1 has a half-life of kel is       7.58

 Dose/AUC (= Clearance/F)

   Parameter   4 gives k0/AUC (CL/F) of     -0.651

Figure 25.3.7 Tabular and Statistical Output provided by Boomer

(Section 1) Preliminary output describing the input/output details, the fitting (optimization) algorithm, integration method and weighting scheme.

(Section 2) Best-fit parameter values with statistical information are provided. The parameter CV values, the WSS, AIC and other values provide information about the model and how well the data have been fit to the model.

(Section 3) The model definition section provides the apportunity to confirm that the model has been described correctly.

(Section 4) The data are provided next as observed x and y values, calculated y values and weight and residual information. The observed data in this table should be checked against the correct values. Systematic differences between observed and calculated values may be detected in this section if the data analysis is incorrect.

(Section 5) The program can calculate the AUC and a number of 'secondary' parameters including MRT, half-life, and Dose/AUC. A zero time point (with zero weight) must be entered for accurate estimates of AUC.

Graphical

(Section 1)
Plots of observed (*) and calculated values (+)
           versus time for [Drug]         . Superimposed points (X)

    13.57      Linear                      13.57      Semi-log
 |                                       |   +                                 
 |   +                                   |                                     
 |                                       |    X                                
 |    +                                  |                                     
 |    *                                  |  X    +                             
 |                                       |                                     
 |                                       |       *                             
 |  X                                    |                                     
 |       +                               |             *                       
 |                                       | *                                   
 |                                       | +           +                       
 |       *                               |                                     
 |                                       |                                     
 |             *                         |                                     
 | *                                     |                  +                  
 | +           +                         |                  *                  
 |                                       |                                     
 |                                       |                                     
 |                  +                    |                                     
 |                  *                    |*                          *         
 |                                       |+                                    
 |                                       |                                     
 |X                          *           |                           +         
 |                                       |                                     
 |                           +           |                                     
 |                                       |                                     
 |                                    +  |                                     
 |                                    *  |                                     
 |                                       |                                     
 |                                       |                                     
 |X  *                                   |                                    X
 |_____________________________________  |X__*_________________________________
    0.000                                  1.700    
 0              <-->             24.     0              <-->             24.    

(Section 2)
 Plot of Std Wtd Residuals (X)            Plot of Std Wtd  Residuals (X)
   versus time for [Drug]                   versus log(calc Cp(i)) for [Drug]         

    1.955                                  1.955    
 |                           X           |         X                           
 |                                       |                                     
 |                                       |                                     
 |                                       |                                     
 |                                       |                                     
 |             X                         |                        X            
 |                                       |                                     
 |X                                      |            X                        
 | XX                                    |                        X      X     
 |                                       |                                     
 0X==X=================================  0====================================X
 |    X                                  |                                  X  
 |                                       |                                     
 |                                    X  |X                                    
 |                  X                    |                   X                 
 |                                       |                                     
 |       X                               |                               X     
 |                                       |                                     
   -1.471                                 -1.471    
      0.0       <-->             24.          1.8       <-->             14.    

Figure 25.3.8 Graphical Output provided by Boomer

(Section 1) A linear and semi-log dot printer-type plot of the observed and calculated y-values versus the x-values. Systematic deviations, indicating a poor weighting scheme or model selection, may be apparent from these graphs.

(Section 2) Standardized weighted residuals versus x-value or log(calculated y value) are very useful tools for detecting a poor model or weighting scheme selection. Any obvious pattern in these plots should be explored as potential evidence of a poor fit to the data.

The Boomer control file used in this analysis is provided here and the complete output file is provided here.

Program Set-up - An Example using Phoenix™ WinNonlin

Analysis Type

The previous Boomer example was an analysis of data collected after an IV infusion of 200 mg over 2 hours. In WinNonlin this could be analyzed as a non Population PK analysis using parameters specified as micro constant, that is kel and V.

The first step is to create a new project.

Creat New Project

Figure 25.3.9 Creating a New Project

Next a new worksheet for the data.

New Worksheet

Figure 25.3.10 Create a New Project

Set up two columns for Time and Concentration with units and enter the data.

Specify Data Columns

Figure 25.3.11 Columns for Time and Concentration

Enter time and concentration

Figure 25.3.12 Columns for Time and Concentration

We can have a look at the data first as a linear and semi-log plot to see what model might be appropriate.

Send Data to XY Plot

Figure 25.3.13 Send Data to XY Plot

Map Time to X and Concentration to Y and execute the plot.

Map time and concentration

Figure 25.3.14 Map time and concentration

Starting with a linear plot, double-click on the y-axis, set it to logarithmic and we have a semi-log plot

Linear Plot of Time versus Concentration

Figure 25.3.15 Linear Plot of Time and Concentration

Set Y Axis to Logarithmic

Figure 25.3.16 Set Y Axis to Logarithmic

Semi-log Plot of Time versus Concentration

Figure 25.3.17 Semi-log Plot of Time versus Concentration

After looking at the semi-log plot we might plan on starting with a one compartment model. We can send the Data Worksheet to a Maximum Likelihood Model.

Create a Model for the Data

Figure 25.3.18 Create a Model for the Data

Uncheck Population as this is single subject data. Use Micro Parameterization although we could choose Clearance. Dosing by Intravenous and One compartment model. Check Infusion and Duration. For most data a Multiplicative Error model works well. This is similar to weighting by the reciprocal of the concentration squared as was done with the Boomer example. Here extended least squares is used and an initial value of 0.1 (or 10%) is entered for the fractional standard deviation.

Set up the PK Model

Figure 25.3.19 Set up the PK Model

We can now enter the dosing information. Two hundred milligram given over two hours starting at time zero.

Enter Infusion Dose Information

Figure 25.3.20 Enter Infusion Dose Information

Initial parameter values can be entered and confirmed and/or adjusted.

Enter Initial Estimate Values

Figure 25.3.21 Enter Initial Estimate Values

Confirm and/or Adjust the Initial Estimates

Figure 25.3.22 Confirm and/or Adjust the Initial Estimates

Here we selected the model from a library within WinNonlin but we could build the model with a graphical or PML code. The same model can be represented by each of these methods.

The model defined graphically

Figure 25.3.23a The Model Defined Graphically

Model defined with PML code

Figure 25.3.24a The Model Described with PML Code

The columns have been mapped as before and it is time for the program to fit the data with the model by adjusting the parameter values.

Below is another example of a graphical and PML code description for a two compartment model with two covariates, one continuous (Weight) and the other categorical (Sex).

Two compartment model defined graphically

Figure 25.3.23b The Model Defined Graphically

Two compartment Model defined with PML code

Figure 25.3.24b The Model Described with PML Code

In Figure 25.3.24b lines 2-4 define the differential equations for the central compartment (A1), output (A0) and the peripheral compartment (A2). Amounts are converted to the observed quantity, concentration, on line 5. Line 6 describes the dosing into the central compartment. The initial error value, Eps, and the error model, here multiplicative are defined on lines 7 and 8. The adjustable parameters in the model are described on lines 9-12. Note the inclusion of Weight (on V) and Sex (on Ke) as two covariates on lines 9 and 10. On line 9 Weight has been normalized by the mean of the study observed weights. mean(Weight) could be replaced by 70 (as a fixed estimate for a population) when the study weights might not be typical. The covariates are listed in lines 13-14. Initial estimates for the adjustable parameters are included on lines 15-18. Lower and upper limits are typically not required. Lines 19-20 provide initial estimates for covariates. The last line, 21, describes initial estimates for the diagonals for the adjustable parameters.

Program Output

After successful completion of the WinNonlin run a number of items will provide information about the fit to the data using the model and selected weighting scheme. This output file will provide tabular, statistical and graphical output which can aid the analyst in the interpretation of the results.

Tabular and Statistical

Overall fit parameters including RetCode, -2LL and AIC are provided in the Overall Table.

Overall Statistics

Figure 25.3.25 Overall Statistics

The best fit values are provided along with Stder and CV%. Note that the CV% values are quite low. These are similar values to those provided by Boomer.

Best fit Parameter Values

Figure 25.3.25 Best fit Parameter Values

Graphical

We can also look at linear and semi-log plots of observed and calculated concentrations versus time. These plot are also indicative of a good fit to the data.

Linear Plot of Concentrations versus Time

Figure 25.3.26 Linear Plot of Concentrations versus Time

Semi-Log Plot of Concentrations versus Time

Figure 25.3.27 Semi-Log Plot of Concentrations versus Time

Another diagnostic plot that is important to consider is the weighted residual plot. This plot can help confirm not only the selected model but also the weighting scheme.

Weighted Residual Plot vesus Time

Figure 25.3.28 Weighted Residual (IWRES) Plot vesus Time (IVAR)

The WinNonlin project file for this example can be downloaded here
Other PK software is listed on https://www.pharmpk.com/soft.html

return to the Course index


This page was last modified: Sunday, 28th Jul 2024 at 5:06 pm


Privacy Statement - 25 May 2018

Material on this website should be used for Educational or Self-Study Purposes Only


Copyright © 2001 - 2025 David W. A. Bourne (david@boomer.org)


Pharmacy Math 2 coverPharmacy Math Part Two
A selection of Pharmacy Math Problems
Get it on Apple Books