After learning how to use the nonlinear mixed effects modeling software NONMEM, one of the first things I tried to do was estimate the absolute bioavailability of a drug that I was working with. I had PK data following IV administration and following subcutaneous injection in monkeys. Using non-compartmental methods I calculated the bioavailability by calculating the ratio of the mean AUC for both routes of administration. While this method was perfectly acceptable, I was attracted the the possibility that I could use all of the data together to derive not only the pharmacokinetic parameters (CL, V, F, and ka) but also the variability in each parameter using NONMEM. Unfortunately the only way to figure out how to do this in NONMEM was ask a NONMEM expert to help me, or spend time working through the NONMEM manuals.
So when a recent email from PharmPK arrived with the folowing question:
Can anybody provide me nonmem script for simultaneous fit of IV and Oral data (population pharmacokinetic modeling) to derive parameters ka and F ?
I decided that I would post not only an answer (the NONMEM control stream and a sample data file), but I would add an explanation of how I was able to arrive at the answer. I hope that the combination of the explanation along with the files will help others understand what to do … and why.
Before we start, let’s make some assumptions:
- The IV data follows a 1 compartment model with constant clearance.
- The oral data follows a first-order elimination and first-order absorption model.
Given these assumptions, let’s draw the compartmental models that we are considering for the 2 routes of administration:
| IV model | Oral model |
|---|---|
![]() |
![]() |
| Click to enlarge | Click to enlarge |
Both models exhibit elimination from a central compartment with PK parameters for the dose, volume of distribution (V) and the clearance (CL) from the central compartment. The oral model has the additional PK parameters for the absorption rate (ka) and the bioavailability (F).
The IV model corresponds to ADVAN1 in NONMEM. The ADVAN1 help reads:
Compt. No. Function Initial Status On/Off Allowed Dose Allowed Default for Dose Default for Obs. 1 Central On No Yes Yes Yes 2 Output Off Yes No No No
The headers mean the following:
- Comp. No. = Compartment number
- Function = Type of compartment (e.g. central peripheral, or output [urine])
- Initial Status = Ability to set the initial status of a compartment to a value (On = Yes, Off = No)
- On/Off Allowed = Ability to turn on or off the compartment. On means NONMEM will calculate values in that compartment, and Off means that NONMEM will ignore that compartment.
- Dose Allowed = Ability to add a dose to the compartment
- Default for Dose = If no other information is provided, the compartment with Yes will be assumed to be the dosing compartment.
- Default for Obs. = If no other information is provided, the compartment with Yes will be assumed to have the drug measurements.
For ADVAN1, the dose is given to compartment 1, and drug measurements are made in compartment 1.
Now the oral model corresponds to ADVAN2 in NONMEM, and that help reads:
Compt. No. Function Initial Status On/Off Allowed Dose Allowed Default for Dose Default for Obs. 1 Depot Of Yes Yes Yes No 2 Central On No Yes No Yes 3 Output Off Yes No No No
For ADVAN2, the dose is given in compartment 1, and drug measurements are made in compartment 2. In addition, it is possible to dose in compartment 2, but that is not the default dosing compartment.
So when initially looking at these, it appears that we need to use 2 different ADVANs to run our model in NONMEM … and, unfortunately, that is impossible in NONMEM. So what is the solution? Well, the solution is the little detail in ADVAN2 about the ability to dose to compartment 2. Pretend for a minute that compartment 1 of ADVAN2 is missing. The rows for compartments 2 and 3 look almost identical to those in ADVAN1. What we need to do is trick NONMEM by using an oral model (ADVAN2), but giving an IV dose. This is accomplished by building your dataset appropriately using the compartment (CMT) variable to tell NONMEM where you want to dose the drug. For IV you will want to dose in compartment 2 (CMT = 2), but for Oral, you will want to dose in compartment 1 (CMT = 1). All concentration measurements should be assigned to compartment 2 (CMT = 2). All other aspects of your datafile should follow NONMEM standards. For ease of analysis, you may want to include a variable that identifies which individuals (or treatments if a crossover study) are on IV and which are on Oral (e.g. RTE = 1 or 2; 1 = IV, 2 = Oral). A sample dataset is here.
Now that your dataset is ready, you need to construct a control stream that will calculate the desired parameters. A sample file is here. The PK block should look like this:
$PK
KA=THETA(1)*EXP(ETA(1))
CL=THETA(2)*EXP(ETA(2))
V=THETA(3)*EXP(ETA(3))
F1=THETA(4)*EXP(ETA(4))
S2=V/1000
For subjects receiving an oral dose, all 4 parameters will be estimated. For subjects receiving an IV dose, only CL and V will be estimated. One advantage of this method of simultaneously fitting IV and oral data is the ability to leverage both datasets (IV and oral) to estimate the clearance and volume of distribution. In turn, this leads to more accurate estimates for the absorption rate constant and the bioavailability.
Please note that I did not fit the sample datset/control stream in NONMEM. The dataset was small (only 2 subjects) and thus some characteristics of the model (e.g. etas) are not reasonable. The samples files are intended to provide the reader a working file with the proper structure.
Good luck, and I hope this helps!






