Faculty of Medical and Health Sciences
Department of Pharmacology & Clinical Pharmacology, University of Auckland
Faculty of Medical and Health Sciences
Department of Pharmacology & Clinical Pharmacology, University of Auckland

User-defined models

[Hide side menu]

Objective and introduction

Objective

The objective is to learn how to define common pharmacological models using Microsoft Excel and four dedicated modelling applications: Berkeley Madonna, Monolix, NONMEM and Phoenix

Introduction

"All models are wrong, some models are useful" George Box 1979 (1)

A model is a representation of observed data or an observed system. Models may be useful to describe a collection of observations and their relationship with one another. More importantly, in attempting to explain and predict observations and their relationships, modelling can be the mechanism to connect description and understanding. Pharmacometrics involves the analysis and interpretation of data and seeks to bridge stamp collecting and physics (to paraphrase Ernest Rutherford quote (2)). 

Metrics is a term used to denote a system of measurement. It involves a certain way of assessing and interpreting parameters, and is used in a variety of fields including economics, education, politics as well as pharmacology. However in pharmacometrics, as with any metrics system, quantitative measurement and estimation does not automatically imply validity and truth.

Models vary in complexity; but inherently modelling involves simplification. Not only does the model have to deal with the known knowns, the known unknowns, but perhaps also the unknown knowns, and the unknown unknowns (paraphrasing a confused/confusing quote from Donald Rumsfield (3)). So while no model can ever speak the truth, a model may be more or less valid depending on the perspective of the modeller and the problem to be solved. There is error inherent in the process of observation and collection of information. Error and variability exists in every step of model building and testing. More useful models attempt to quantify and classify error and variability.

"In pharmacology models are ultimately expressed by mathematical equations" (Bourne 1995 (4)). Equations can encapsulate and describe large amounts of information. Differential equations are used to describe rate of change of a variables over time. There are different numerical methods of solving differential equations such as the Runge-Kutta method (RK4) developed by  mathematicians several decades ago. The robustness of this and other forms of iterative solution has been demonstrated by their successful use for satellite exploration of the solar system. Improvements in accuracy with which a model describes observations and estimatesparameters, may come from more powerful and robust mathematical functions and repeated observations.

Pharmacometrics uses mathematical modelling enabled by software applications to estimate parameters and define and predict relationships between variables. Several different computer software programs can be used for this purpose, all with unique features and limitations. These software programs can render complex mathematics useful to the nonmathematician in solving pharmacometric problems.

In order to use pharmacometric modelling, it is necessary to understand the components of model equations. Equations summarise large amounts of data with a small number of parameter values. A parameter is a constant that is estimated, e.g. volume of distribution, clearance, rate constants for elimination/absorption/equilibration, EC50. Parameters are adjusted during the modelling process to obtain the best fit to the data. Variables that are fixed and do not change in the modelling process are true constants e.g. dose, infusion time. The dependant variable is the variable whose value the equation describes, e.g. concentration in pharmacokinetic equations, effect in pharmacodynamic equations. Parameters and the dependant variable are related by mathematical operators. Time is the only truly independent variable, as it is the only variable we cannot control.

In pharmacology models can not only describe data such as dose-concentration, concentration-effect, but more usefully predict these relationships. This is most useful if the model can be used to define parameters not just for the data observed for particular individuals at particular times, but for different individuals at different times. Population modelling has been used since the 1970s to describe and predict pharmacokinetic, pharmacodynamic and linked PKPD relationships for a population rather than just individuals. NONMEM is the most widely used software tool for population modelling, and uses Fortran source code.

Simulation involves the generation of data from a proposed model equation. Simulation has a role in both model generation and model evaluation. Software programs such as Excel and Berkeley Madonna involve simulation of data. Software programs such as NONMEM, Monolix and Phoenix use nonlinear regression analysis to simulate data and estimate parameters. Observed values of collected data can be compared with predicted values for the dependant variables.

Differences in predicted and observed values may be due to error and variation. The goal of model development is to find parameter values that decrease the differences between predicted and observed values, in other words to develop a model that fits the data and describes it well. Models are evaluated by tabular and graphical representations and statistical methods. Error modelling is used to describe the variability in how well the data is described by a parameter. In fact measurement of error involves estimation. Statistical error describes the difference between observed and expected values. Residual error is an observable estimate of unobservable statistical error. Residuals is the term given to describe the difference between group mean and individual values in a sample. Standard error (SE) is a measure of precision. It is used to estimate a population parameter from a sample. Standard error is used to define a range in which the true population mean value should lie. Confidence intervals are calculated from standard error. Coefficient of variation is another measure of variability, and is equal to the standard deviation divided by the mean (multiplied by 100 to express as a percentage). All modelling solutions involve assumption. A common assumption is that the independent variable can be measured without significant error, however this is unlikely to be always true.

Modelling is used to quantify and summarise data and furthermore to explain and explore mechanism and predict values. The usefulness of a model depends on the problem to be solved, the population to which it is applied, and the perspective of modeller.

There are different types of structural models used in pharmacology: compartment models, mechanistic or physiological models, empirical models, and hybrid approaches. Traditional compartmental models describe a number of well stirred compartments. The number of compartments and structure of the model is determined by the data and route of administration. Noncompartmental modelling can be described as including nonparametric data, and a more general approach rather than a structural system. Mechanistic models are based on physical and physiological principles. For example physiological models may include factors describing blood flow, elimination rate, partition coefficients, diffusion, and the kinetics of receptor binding. Empiric modelling however requires few assumptions about the data generating mechanisms and is useful when little is known about underlying physiological processes (black boxes).

Model equations and parameter estimates are useful to summarise large amounts of data. Excel & Berkeley Madonna simulate data using initial estimates and a model equation. This is a potentially useful step for developing a model. MONOLIX, NONMEM and Phoenix are more powerful software packages that perform nonlinear regression analysis and can be used to estimate parameters, in addition to simulation.

Introduction by Anita Sumpter (2008).

References

  1. Box GEP. Robustness in the strategy of scientific model building. In: Launer RL, Wilkinson GN, editors. Robustness in Statistics; 1979. p. 202.
  2. Reference to Ernest Rutherford quote "Science is either stamp collecting or physics". http://en.wikiquote.org/wiki/Ernest_Rutherford. All science is either physics or stamp collecting. As quoted in "Rutherford at Manchester" (1962) by J. B. Birks.
  3. Paraphrased Donald Rumsfield quote http://en.wikiquote.org/wiki/Donald_Rumsfield. "Reports that say that something hasn't happened are always interesting to me, because as we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns -- the ones we don't know we don't know. And if one looks throughout the history of our country and other free countries, it is the latter category that tend to be the difficult ones. " Department of Defense news briefing, February 12, 2002 [1].
  4. Bourne D. Mathematical Modeling of Pharmacokinetic Data. CRC Press, Boca Raton, 1995. Preface x.

Workshop hints

Note: All files should be loaded from and saved to your Pharmacometrics Data\User Defined Models folder for this assignment. You may find it useful to create a separate folder for each program inside the User Defined Models folder as you will create several files during this assignment.


Some hints (shown in grey boxes) refer to changes needed for subsequent problems.


You may find it easier to read  this page if your click on the "[Hide Side Menu]" text at the top

Excel

Find the file Pharmacometrics Data\User Defined Models\3models.xls

  1. Open 3models.xls with Excel.
  2. Look at each of the 3 worksheets (bo1, k01, emaxc).
  3. Identify:
    1. The model equation
    2. The model parameters
    3. The independent variable
  4. Export the simulated data from each of the worksheets in 3models.xls to a format that other programs can read using the following steps
  5. Create a new Excel workbook to make a data file for each worksheet. Add the following headings in the top row of the data file. It is important to put the # before ID so that the  file can be used for NONMEM. The DV column name means Dependent Variable (i.e. the observation).

    #ID TIME DV

    For emaxc you should use #ID CONC and DV headings for the data file columns.

  6. Fill the data file #ID column down to row 12 with the value 1. Copy the values from column C in the bo1 model worksheet into the data file TIME column. Copy the concentrations from column E (simulated observations) in the bo1 model worksheet into the data file DV column ().

    Important: use Paste Special Values rather than a simple paste to prevent the formulae in column E being copied to the data file.

    The data file for the bo1 model should look like similar to Table 1, but your DV values will be different.

        A B D
    1 #ID TIME DV
    2 1 0 9.9
    3 1 1 7.2
    4 1 2 5.3
    5 1 3 4.6
    6 1 4 2.4
    7 1 5 3.2
    8 1 6 2.6
    9 1 7 1.1
    10 1 8 -1.4
    11 1 9 0.4
    12 1 10 1.8
    Table 1. Data file for bo1.
  7. Now save the data file using 'Save As' and choose CSV (Comma delimited, *.csv) format. 
  8. Save in your Pharmacometrics Data\User Defined Models folder
  9. Name the file bo1.csv (Be careful  -- use bo1.csv NOT b01.csv (oh NOT zero).
  10. Repeat these steps to create k01.csv and emaxc.csv files from the worksheets in 3models.xls.
  11. The k01.csv data file should look like this:
        A B E
    1 #ID TIME DV
    2
    1
    0
    0.5
    3
    1
    1
    7.8
    4
    1
    2
    14.1
    5
    1
    3
    19.6
    6
    1
    4
    24.4
    7
    1
    5
    25.4
    8
    1
    6
    26.5
    9
    1
    7
    29.1
    10
    1
    8
    30.6
    11
    1
    9
    30.7
    12
    1
    10
    30.4
  12. The emaxc.csv data file should look like this. Check that the column B heading is CONC.
        A B C
    1 #ID CONC DV
    2
    1
    0
    -1.5
    3
    1
    1
    18.9
    4
    1
    2
    32.9
    5
    1
    3
    60.1
    6
    1
    4
    51.9
    7
    1
    5
    68.5
    8
    1
    6
    69.0
    9
    1
    7
    74.8
    10
    1
    8
    77.1
    11
    1
    9
    72.6
    12
    1
    10
    69.3
    Table 3. Data file for emaxc.

Berkeley Madonna

  1. Open Berkeley Madonna shortcut in folder "Pharmacometrics Programs".
  2. Add code to the Equations window defining the STARTTIME, STOPTIME, integration stepsize (DT), the output interval (DTOUT), the model parameters and the model equation (code shown in Figure 1 for the bo1 model).
  3. Click on Run to run the model.
  4. Save your model with the name bo1.mmd (in your Pharmacometrics Data\User Defined Models\Madonna folder).
  5. View a table of times and concentrations by clicking on the Table icon in the Run 1 graph window.

Repeat the above steps for the k01 and emaxc models. Use 3models.xls to find the formula to code the model equation for  "Conc" for k01 and "Effect" for emaxc. Use parameter names and values which are the same as those in the 3models.xls worksheets. Berkeley Madonna is not case sensitive but it is good practice to try and use the same case for any variables you use in the code.

METHOD RK4
STARTTIME = 0
STOPTIME = 10
DT = 0.02
DTOUT = 1
Dose = 100
CL = 3
V = 10
Conc = Dose/V*EXP(-CL/V*Time)

 Figure 1. Code for bo1.mmd (Berkely Madonna)

Hint: for the Emax model which uses Conc as the independent variable you may wish to rename the default variable called Time with a RENAME statement:

RENAME Time=Conc

Put this statement after the DTOUT statement.

STARTTIME, STOPTIME and DTOUT should still used to define the starting, ending and output interval values for Conc.

You  will need to add Effect as a variable to the graph by clicking on the graph and using the Graph menu.

Monolix

  1. Open the Monolix shortcut in folder "Pharmacometrics Programs".
  2. If you are asked for a Monolix licence key then open the  "Pharmacometrics Programs\license.txt" file. Then copy and paste the Monolix license key. You will only need to do this the first time you use Monolix.
  3. Click on the
     
    New Project icon (top left of Monolix GUI).
  4. In Monolix , click 'The data', locate your bo1.csv file. This can be done by copying the path to the folder from Windows Explorer into the Monolix "Select datafile File name:" box.   e.g. P:\My Pharmacometrics\Pharmacometrics Data\User Defined Models
  5. Select bo1.csv and click 'Open'. The data information window will appear.
  6. Monolix should identify that your input file has a header row and your data should appear under the headings: ID TIME Y. If the 'Use header' box is not checked then click on it so that Monolix uses the headers in the input file. Click accept if Monolix has assigned the correct headings.

    You can select the type of data associated with the headings manually by clicking the drop down menus. If the independent variable is not TIME then select X for the type. You will need to do this for the CONC variable for the emaxc.csv file.

  7. Instead of using the model library, we will use MLXTRAN to write out the bo1 model. Start by opening a text editor (e.g. Editplus) and enter the code shown in Figure 2.
  8. ; One compartment bolus input and first order elimination

    INPUT:
    parameter={V,CL} ; PK parameters

    EQUATION:
    dose=100 ; nominal dose
    conc=dose/V*exp(-CL/V*t)

    OUTPUT:
    output = {conc}

     Figure 2. Code for bo1_mlxt.txt

    IMPORTANT: MLXTRAN is case sensitive. Take care to be consistent with upper and lower case names.

  9. Save the model as bo1_mlxt.txt in a User Defined Models\Monolix folder.
  10. Click 'The structural model' and the model library will appear. Click 'Other list' and navigate to your "User Defined Models" folder and click 'OK'. Select bo1_mlxt.txt and click 'Compile', then 'Accept'. You may have to wait a few seconds for the model to compile.

    If you get a compile error. Double check that your code is identical to that shown in the Figure and be sure to press ENTER after the last line of code - this is required to 'end' the last statement.


  11. Change the initial parameter estimates under Fixed effects. Holding the mouse over each box will tell you, which parameter the value is for.
  12. Set the 'Stand. dev. of the random effects' to 0 for each parameter by clicking on the '1' values in the 'Covariance model' box of values. These should change to 0 and the initial values for the SD of the random effects should change to 0 with a gray background..

    Because these are data from a single individual, there is no between subject variability (random effects). The SD of random effects is therefore 0.

  13. Set the residual error model to 'const' (additive error).
  14. Set the 'Residual error parameters' to 1 for bo1 and k01 and 5 for emaxC..
  15. Click 'Check initial fixed effects'. A plot of predictions based on the model and initial parameter estimates will display along with the observed values.

    You can visualise the effect of changing your parameter estimates by adjusting the values in the bottom left of the window. When you have chosen initial estimates that form a prediction that is similar to the observations, click 'Set as initial values' to apply these values and close the window.

  16. Click onthe check boxes  'Estimate the Population Parameters', 'Estimate the Fisher Information Matrix' and 'Estimate log likelihood' in the 3rd line of the MONOLIX window. Make sure the other boxes are not checked especially 'Estimate the individual parameters'.
  17. IMPORTANT: Save the project as bo1_project.mlxtran in your User Defined Models\Monolix folder before trying to "Run" the model.
  18. Estimate the parameters by clicking on 'Run'. This will take a while depending on the complexity of the model. During the estimation process you can see how the parameter estimates are being changed and settle down towards the final value.
  19. When the estimation finishes click on 'List' button below 'Graphics' at the bottom of the Monolix window. Click to check the box for 'Individual Fits' and 'VPC' as Outputs. Uncheck all the other types of plot. 
  20. Click on OK to close the 'Graphics' list window.
  21. Then click on 'Display the Graphics' at the top of the Monolix window. 
  22. Look at the Individual fits for Conc and Effect.You can select the graphic plots by clicking on the tab at the bottom of the 'Figures' window.
  23. Save a pdf copy of each plot in your Time Course of Drug Effect\Monolix project folder.
  24. Look at the VPC plots for Conc and Effect.
  25. Click on Settings, use the default settings and add 'Observed Data'. Then click on 'Bins and PI' at the bottom of the list of options. Click on 'Equal width' and then click on 'Display'. Save a pdf copy of the VPC plot in your User Defined Models\Monolix project folder.
  26. View the parameter estimates by clicking   'Last Results'. A text file containing these results is saved in a 'pop_parameters.txt' in the project folder.
  27. If you don't get an error message about "CAT arguments dimensions are not consistent" then go to step 31.
  28. You may get an error message about "CAT arguments dimensions are not consistent". This is a Monolix bug which happens if you have checked the 'Estimate the individual parameters' step. Close the error message window. Because of this bug you cannot see graphs showing the predictions.
  29. A work around for this bug it to click on "Use the last estimates". This transfers the final parameter estimates to the initial estimates.
  30. Click 'Check initial fixed effects'. A plot of predictions based on the model and final parameter estimates will display along with the observed values.
  31. Close the 'Check initial fixed effects' window.
  32. Repeat the above steps for the k01 and emaxc models using the following MLXTRAN codes.
  33. When loading the data for the emaxc model set the column named CONC to a type of X.
  34. Save each project as k01_project.mlxtran or emaxc_project.mlxtran before running the model.
    ; One compartment zero-order input and first order elimination

    INPUT:
    parameter={V,CL} ; PK parameters

    EQUATION:
    dose=100 ; nominal dose rate
    conc=dose/CL*(1-exp(-CL/V*t))

    OUTPUT:
    output = {conc}

    Figure 3. Code for k01_mlxt.txt

    ; Emax pharmacodynamic model

    INPUT:
    parameter={Emax,C50} ; PD parameters
    regressor={conc} ; Conc is the independent variable

    EQUATION:
    e=Emax*conc/(C50+conc) ; do not use 'effect'. This is a reserved word in Monolix.

    OUTPUT:
    output = {e}

     

    Figure 4. Code for emaxc_mlxt.txt

Phoenix

  1. Open the Phoenix shortcut in the folder "Pharmacometrics Programs"
  2. If you do not see licensing messages on the splash screen during startup then goto Edit Preferences Licensing Float Licensing Configuration. Enter in the Add box pharsight.uoa.auckland.ac.nz then click on Add. Goto License Management and click on TS2. Do not click on PHX_NLME and PHX_WNL. You will only have to do this the first time you use Phoenix.
  3. Click on 'File New Project' in the menu line
  4. Change the Project name to 'User Defined Models'
  5. Right click on 'Data' in the User Defined Models list and click on 'Import'
  6. Navigate to the "Pharmacometrics Data\User Defined Models" folder and open the 'bo1.csv' file you created previously. Make sure that you do not have 'bo1.csv' open in Excel because Phoenix cannot open the file if it is open in Excel.
  7. Click on 'Finish'

    This adds the bo1 data set to the project. if you make changes to bo1.csv you will need to delete the bo1 data set and import the changed bo1.csv file again.


  8. Right click on 'WorkFlow' then 'New', 'Phoenix Modeling', 'Phoenix Model'
  9. Change the Workflow Phoenix Model name to 'bo1'
  10. Click on Workflow in the Object Browser then click on the bo1 worklfow. Click on the 'Setup' tab then on 'Main''
  11. Drag the Data bo1 object to the bo1 'Setup Main (bo1)' window
  12. Click on the Mappings table radio button to link Time with TIME and CObs with DV.
  13. Click on 'Edit as Textual'. This allows you to write the model without relying on the Built In library of models.
  14. Click on the bo1 'Setup' tab (top of workflow bo1 window) then on 'Model' to open a window containing the test() model function.
  15. Replace the contents of the 'Model' window with the code shown below then click on 'Main (bo1)'. 
  16. Check that you can see the "No warnings" message (top of the lower part of the workflow bo1 window). If there are warnings then click on this tab and correct the code or mapping. 
  17. bo1(){
    covariate(Time)

    fixef(grpV = c(, 10, ))
    fixef(grpCL = c(, 3, ))
    stparm(V = grpV)
    stparm(CL = grpCL)

    Conc = 100 / V*exp(-CL/V*Time)

    error(CEps = 1)
    observe(CObs(Time) = Conc + CEps)
    }

     Figure 5. Code for bo1 text model
  18. Return to the Workflow bo1 object and click on the 'Setup Main (bo1)' icon.
  19. Click on the Initial Estimates tab and set appropriate initial parameter values. Change the plot variables to 'Conc v Time' (drop down box under the parameter values). Confirm that the initial estimates give a reasonable fit to the data.Click on the 'Structure' tab and UN-check the 'Population?' box (upper left) to peform an individual subject analysis..
  20. Click on the Plots tab, then Disable All, then select Ind DV, IPRED vs IVAR (individual plot).
  21. Save the project with the name User Defined Models.phxproj in a User_Defined_Models\Phoenix folder.
  22. Uncheck the 'Population?' box before trying to execute. This is essential to run an individual model and see the plot.
  23. Select the bo1 icon in the Workflow (Object Browser window). Click on the Execute bo1 icon at the top of the Phoenix window. This will start the parameter estimation process.
  24. Click on Output Data Theta icon to see the parameter estimates.
  25. Create a new Excel workbook in the User Defined Models\Phoenix folder called "User Defined Model Results.xlsx". 
  26. Select the Theta table values (including columns and rows) then copy and paste the parameter estimates to the Excel workbook.
  27. Create a new Word document in the User Defined Models\Phoenix folder called "User Defined Model Results.docx". 
  28. Copy the Excel parameter table and paste it into the Word document.
  29. Look at the Ind DV, IPRED vs IVAR plot then right click on it and copy a bitmap to clipboard. Paste the clipboard contents to the Word document..
  30. Check the 'Population?' box to peform a population analysis. This willl allow a VPC plot to be generated.
  31. Set up a visual predictive check by clicking on the Sim./Pred Check button then click on Main and set # Replicates to 100, click on Binning and check the None option, click on Quantiles and use the values (5, 50, 95) for a 90% prediction interval, then click on Quantile % and set the values to 2.5, 50 , 97.5 for a 95% confidence interval
  32. Click on the Plots tab and select Pop PredCheck SimQCI (visual predictive check).
  33. Select the bo1 icon in the Workflow (Object Browser window). Click on the Execute bo1 icon at the top of the Phoenix window. This will create the VPC (visual predictive check)..
  34. Look at the Plot PopPredCheckQI plot then right click on it and copy a bitmap to clipboard. Paste the clipboard contents to the Word document.
  35. Repeat steps 5 to 33 with the k01.csv and emaxc.csv data sets. Replace the contents of the Setup Model window with the code shown below for the k01 and emaxc text models. Note for the emaxc model you should map Conc to CONC and Eobs to DV. 
  36. k01(){
    covariate(Time)

    fixef(grpV = c(, 10, ))
    fixef(grpCL = c(, 3, ))
    stparm(V = grpV)
    stparm(CL = grpCL)

    Conc = 100 / CL*(1-exp(-CL/V*Time))

    error(CEps = 1)
    observe(CObs(Time) = Conc + CEps)
    }

     

    Figure 6. Code for k01 text model

    emaxc(){
    covariate(Conc)
    fixef(grpC50 = c(, 3, ))
    fixef(grpEmax = c(, 100, ))
    stparm(C50 = grpC50)
    stparm(Emax = grpEmax)

    E = Emax * Conc / (C50 + Conc)

    error(EEps = 5)
    observe(EObs(Conc) = E + EEps)

    }

     Figure 7. Code for emaxc text model

     

  37. Save the project as "User Defined Models" in the User Defined Models\Phoenix folder.

NONMEM

  1. Open the NONMEM shortcut in the folder "Pharmacometrics Programs".
  2. Change directory to the User Defined Models folder by typing this command in the NONMEM window then press <ENTER>.
    cd User*

    All commands shown in the green boxes should end by pressing <Enter>.


  3. Make a NONMEM directory then change to the NONMEM folder by typing this command in the NONMEM window.
    md NONMEM

    You only have to make the directory once. You dont have to give the md NONMEM command when you are working on the K01 and emaxc problems.


  4. Change to the NONMEM directory from the User Defined Models directory.
    cd NONMEM
  5. Use the Windows Notepad (or EditPlus) to create the following code in a file named bo1.ctl e.g. by using the command:

    notepad bo1.ctl
  6. Enter the code for bo1.ctl shown in Figure 2.

    $PROB one compartment bolus
    $INPUT ID TIME DV
    $DATA ..\..\bo1.csv
    $ESTIM METHOD=CONDITIONAL
    $COV
    $THETA
    (0,3,) ; POP_CL
    (0,10,) ; POP_V
    $OMEGA
    0 FIX ; ETA_CL
    0 FIX ; ETA_V
    $SIGMA 1 ; ERR_SD
    $PRED
    CL=THETA(1)*EXP(ETA(1))
    V=THETA(2)*EXP(ETA(2))
    CONC=100/V*EXP(-CL/V*TIME)
    Y=CONC + ERR(1)
    $TABLE ID TIME CL V Y
    NOPRINT ONEHEADER FILE=bo1.fit

    Figure 2. NM-TRAN code for bo1.ctl (NONMEM)

    The $OMEGA parameters are FIXed to 0. This is because there is only one individual being modelled. These random effects parameters are used to describe between subject variability when there is more than one individual.


  7. Save the file. Check using Windows Explorer that you can find the file "bo1.ctl" in the User Defined Models\NONMEM folder.
  8. The data file name must match in the $DATA record of the bo1.ctl file.

    In order for NONMEM to find the data file the $DATA record has to include a path relative to the folder where NONMEM is executed. This is why the '..\..\' is put before the name of the data file which is located in the User Defined Models folder.


  9. Execute NONMEM with this command in the NONMEM window:

    nmgo bo1

    When you get errors from NONMEM with the nmgo command then please read the error message carefully and try to understand what it is telling you. The usual errors that occur with these example problems will give you some clues to what you might need to change in your ctl file.


    Commands can be recalled by using the Up arrow on your keyboard. You can easily repeat the command without more typing or edit it to save the amount of typing you do.


  10. Use the Windows Notepad or EditPlus to open this file and look at the saved results in the '.smr' file. The results are saved in a folder with the same name as the ctl file but with the extension '.reg' e.g. use the following command or open the file using the Windows Explorer.

    notepad bo1.reg\bo1.smr

  11. Create a plot of  TIME versus Y (predicted conc) and  DV ( observed conc) using the bo1.fit file in the bo1.reg results folder. 
  12. Use Excel to open the fit file. You need to reformat the Excel file in order to see its contents.
  13. Select column A then click on the "Data" menu item then click on "Text to Columns". Click on "Finish". This will separate the values into separate columns.
  14. Select all cells in the worksheet (e.g. press ctrl-A) then right click on a cell and click on "Format cells". Click on the "General" option.. This will make the numeric values easier to read.
  15. Delete row 1 which contains the value "TABLE 1".
  16. Click on cell A1 then click on the "Data" menu item then click on "Data Filter". This will let you choose rows with specific values of DVID by clickiing on the arrow in the corner of the column with the heading "DVID".
  17. Filter the rows using DVID=1 then create a graph of TIME versus Y (predicted conc) and  DV ( observed conc).
  18. Repeat the above steps for the K01 and emaxc models. For NONMEM you should change the bo1.ctl file and save it with a suitable name such as K01.ctl or emaxc.ctl.
  19. Change the NONMEM model code as follows for the K01 and emaxc data.
  20. $PROB one compartment infusion
    $INPUT ID TIME DV
    $DATA ..\..\k01.csv
    $ESTIM METHOD=CONDITIONAL
    $COV
    $THETA
    (0,3,) ; POP_CL
    (0,10,) ; POP_V
    $OMEGA
    0 FIX ; ETA_CL
    0 FIX ; ETA_V
    $SIGMA 1 ; ERR_SD
    $PRED
    CL=THETA(1)*EXP(ETA(1))
    V=THETA(2)*EXP(ETA(2))

    CONC=100/CL*(1-EXP(-CL/V*TIME))
    Y=CONC + ERR(1)
    $TABLE ID TIME CL V Y
    NOPRINT ONEHEADER FILE=k01.fit

    Figure 3. NM-TRAN code for k01.ctl (NONMEM)

    $PROB emax pharmacodynamic model
    $INPUT ID CONC DV
    $DATA ..\..\emaxc.csv
    $ESTIM METHOD=CONDITIONAL
    $COV
    $THETA
    (0,100,) ; POP_EMAX
    (0,3,) ; POP_C50
    $OMEGA
    0 FIX ; ETA_EMAX
    0 FIX ; ETA_C50
    $SIGMA 1 ; ERR_SD
    $PRED
    EMAX=THETA(1)*EXP(ETA(1))
    C50=THETA(2)*EXP(ETA(2))

    EFFECT=EMAX*CONC/(CONC+C50)
    Y=EFFECT + ERR(1)
    $TABLE ID CONC EMAX C50 Y
    NOPRINT ONEHEADER FILE=emaxc.fit

    Figure 4. NM-TRAN code for emaxc.ctl (NONMEM)

Assignment

  1. Describe the three models you have looked at in Excel:
    1. Show a graph of the Excel simulated data for each model.
    2. What do the model parameters mean?
    3. What are the kinds of experimental data they might be used to describe?
    4. Can you suggest a re-parameterization for each of the models?
  2. Write up the results of your simulations with Berkeley Madonna showing the model definition and the graph and table for each of the three models.
  3. Write up the results of parameter estimation using Monolix, Phoenix and NONMEM for each of the three models. Compare the results and describe any differences in the final parameter estimates and standard errors (if available). Try to provide an explanation for any differences you find.