Difference between revisions of "Visualization"
m (→Data exploration) |
m (→Introduction) |
||
(41 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | <div style="color: #2E5894; padding-left: 1.4em; padding-right:2.2em; padding-bottom:0.8em; padding:top:1">[[Image:attention4.jpg|45px|left|link=]] | ||
+ | (If you are experiencing problems with the display of the mathematical formula, you can either try to use another browser, or use this link which should work smoothly: http://popix.lixoft.net) | ||
+ | </div> | ||
+ | |||
== Introduction == | == Introduction == | ||
− | Before deciding to model data, it is very important to be able to visualize it. This is especially the case for longitudinal data when we want to see how an outcome varies with time or as a function of another outcome. We may also want to visualize how the individual covariates are distributed, visually detect if there are relationships between variables, visually compare data from different groups, etc. Development of such visual exploration tools poses no methodological problems. It is simple to write a Matlab or R code for one's own needs. To | + | Before deciding to model data, it is very important to be able to visualize it. This is especially the case for longitudinal data when we want to see how an outcome varies with time or as a function of another outcome. We may also want to visualize how the individual covariates are distributed, visually detect if there are relationships between variables, visually compare data from different groups, etc. Development of such visual exploration tools poses no methodological problems. It is simple to write a [http://www.mathworks.fr/products/matlab/ Matlab] or [http://www.r-project.org/ R] code for one's own needs. To |
− | illustrate the data visualization part of this chapter, we have created a little Matlab toolbox called $\popixplore$ ({{filepath:popixplore.zip}}) which can be freely downloaded and used. | + | illustrate the data visualization part of this chapter, we have created a little Matlab toolbox called [[Media:popixplore.pdf| $\popixplore$]] ({{filepath:popixplore 1.1.zip}}) which can be freely downloaded and used. |
It may also be useful to be able to visualize the model itself by undertaking a sensitivity analysis to look at how the structural model changes when we vary one or several parameters. This is important for truly understanding the structural model, i.e., what is behind the given mathematical equations. In the modeling context, we may also want to visually calibrate parameters in order to obtain predictions as close as possible to the observations. Developing such a tool is a difficult task because the tool needs to be able to easily input a model using some coding language, perform complex calculations, and provide a decent graphical interface (e.g., one that lets you easily modify the model parameters). | It may also be useful to be able to visualize the model itself by undertaking a sensitivity analysis to look at how the structural model changes when we vary one or several parameters. This is important for truly understanding the structural model, i.e., what is behind the given mathematical equations. In the modeling context, we may also want to visually calibrate parameters in order to obtain predictions as close as possible to the observations. Developing such a tool is a difficult task because the tool needs to be able to easily input a model using some coding language, perform complex calculations, and provide a decent graphical interface (e.g., one that lets you easily modify the model parameters). | ||
− | Various model visualization tools exist, such as | + | Various model visualization tools exist, such as [http://www.berkeleymadonna.com/index.html Berkeley Madonna], specialized in the analysis of dynamical systems and the resolution of ordinary differential equations. Here, we use [http://www.lixoft.eu/products/mlxplore/mlxplore-overview/ $\mlxplore$] for some different reasons: |
<ul> | <ul> | ||
− | * $\mlxplore$ uses the $\mlxtran$ language which is extremely flexible and well-adapted to implementing complex mixed-effects models. Indeed, with $\mlxtran$ we can implement pharmacokinetic models with complex administration schedules, include inter-individual variability in parameters, define a statistical model for the covariates, etc. Another extremely important aspect of $\mlxtran$ is that it rigorously adopts the model representation formalisms proposed in $\wikipopix$. In other words, model implementation is completely in sync with its mathematical representation. | + | * $\mlxplore$ uses the [http://www.lixoft.com/wp-content/resources/docs/modelMLXTRANtutorial.pdf $\mlxtran$] language which is extremely flexible and well-adapted to implementing complex mixed-effects models. Indeed, with $\mlxtran$ we can implement pharmacokinetic models with complex administration schedules, include inter-individual variability in parameters, define a statistical model for the covariates, etc. Another extremely important aspect of $\mlxtran$ is that it rigorously adopts the model representation formalisms proposed in $\wikipopix$. In other words, model implementation is completely in sync with its mathematical representation. |
<br> | <br> | ||
Line 20: | Line 24: | ||
== Data exploration == | == Data exploration == | ||
+ | |||
The following example involves 80 individuals that receive a unique dose of an anticoagulant at time $t=0$. For each patient we then measure the plasmatic concentration of the drug at various times. This drug can cause undesirable side effects such as nose bleeds. If this happens, we also record the times at which this happens. The data is recorded in columns of a single text file {{Verbatim|pkrtte_data.csv}}. In this example, the columns are: | The following example involves 80 individuals that receive a unique dose of an anticoagulant at time $t=0$. For each patient we then measure the plasmatic concentration of the drug at various times. This drug can cause undesirable side effects such as nose bleeds. If this happens, we also record the times at which this happens. The data is recorded in columns of a single text file {{Verbatim|pkrtte_data.csv}}. In this example, the columns are: | ||
Line 43: | Line 48: | ||
− | {{ImageWithCaption|image=exploredata0.png | + | {{ImageWithCaption|image=exploredata0.png|caption=The datafile {{Verbatim|pkrtte_data.csv}} }} |
Line 67: | Line 72: | ||
− | How we graphically represent data depends on the type of data. Often for continuous data we use "spaghetti plots", where all of the observations are given on the same plot, and those for each individual are joined up using line segments. Time-to-event data are usually represented using Kaplan- | + | How we graphically represent data depends on the type of data. Often for continuous data we use "spaghetti plots", where all of the observations are given on the same plot, and those for each individual are joined up using line segments. Time-to-event data are usually represented using [https://en.wikipedia.org/wiki/Kaplan-Meier_survival_curve Kaplan-Meier plots], i.e., an estimate of the survival function for the first event. In the case of repeated events, we can instead represent the average cumulative number of events per individual. |
Line 78: | Line 83: | ||
− | {{ImageWithCaption|image=exploredata1.png | + | {{ImageWithCaption|image=exploredata1.png|caption=Graphical representation of the data. Left: concentrations, right: average cumulative number of events per individual}} |
Line 84: | Line 89: | ||
− | {{ImageWithCaption|image=exploredata2.png | + | {{ImageWithCaption|image=exploredata2.png|caption=Concentration profiles per dose group}} |
− | {| cellpadding=" | + | {| cellpadding="10" cellspacing="0" |
− | |style = "width:50%"| [[File:exploredata3a.png | + | |style = "width:50%"| [[File:exploredata3a.png]] |
− | |style = "width:50%"| [[File:exploredata3b.png | + | |style = "width:50%"| [[File:exploredata3b.png]] |
|- | |- | ||
|cellspan="2" align="center" style="text-align:center"| ''Distribution of weight and gender per dose group'' | |cellspan="2" align="center" style="text-align:center"| ''Distribution of weight and gender per dose group'' | ||
Line 97: | Line 102: | ||
{{Remarks | {{Remarks | ||
− | |title= | + | |title=Remark |
− | |text=The data file {{Verbatim|pkrtte_data.csv}} and the matlab script {{Verbatim|pkrtte_demo.m}} are available in the folder {{Verbatim|demos}} of $\popixplore$ {{filepath: | + | |text=The data file {{Verbatim|pkrtte_data.csv}} and the matlab script {{Verbatim|pkrtte_demo.m}} are available in the folder {{Verbatim|demos}} of $\popixplore$: {{filepath:popixplore 1.1.zip}}. |
}} | }} | ||
Line 105: | Line 110: | ||
==Model exploration== | ==Model exploration== | ||
+ | |||
+ | ===Exploring the structural model=== | ||
Suppose that we now want to visualize the following joint model which is one that can be used for simultaneously modeling PK and time-to-event data: | Suppose that we now want to visualize the following joint model which is one that can be used for simultaneously modeling PK and time-to-event data: | ||
Line 145: | Line 152: | ||
Here, an administration of type 1 (resp. 2) is an oral (resp. iv) administration. | Here, an administration of type 1 (resp. 2) is an oral (resp. iv) administration. | ||
− | The tasks, i.e., how the model is to be used, | + | The tasks, i.e., how the model is to be used, are then coded as an $\mlxplore$ project: |
− | {{ | + | {{MLXPlore |
|name=joint1_project.txt | |name=joint1_project.txt | ||
|text= | |text= | ||
Line 175: | Line 182: | ||
− | {{ImageWithCaption|image=exploremodel1.png | + | {{ImageWithCaption|image=exploremodel1.png|caption=Exploring the model using $\mlxplore$ }} |
Line 184: | Line 191: | ||
|title= | |title= | ||
|text= | |text= | ||
− | |code={{ | + | |code={{MLXPloreForTable |
|name=joint2_project.txt | |name=joint2_project.txt | ||
|text= | |text= | ||
Line 194: | Line 201: | ||
adm2={time=0:12:144, amount=25,type=1} | adm2={time=0:12:144, amount=25,type=1} | ||
</pre> }} | </pre> }} | ||
− | |image=[[File:exploremodel2.png | + | |image=[[File:exploremodel2.png]] }} |
Line 203: | Line 210: | ||
|title= | |title= | ||
|text= | |text= | ||
− | |code={{ | + | |code={{MLXPloreForTable |
|name=joint3_project.txt | |name=joint3_project.txt | ||
|text= | |text= | ||
Line 215: | Line 222: | ||
trt1={adm1, adm2} | trt1={adm1, adm2} | ||
</pre> }} | </pre> }} | ||
− | |image= [[File:exploremodel3.png | + | |image= [[File:exploremodel3.png]] |
}} | }} | ||
+ | |||
+ | ===Exploring the statistical model=== | ||
One of the main advantages of $\mlxplore$ is its ability to graphically display the predicted distribution of the functions of interest $Cc$ and $h$ when certain parameters of the model are assumed to be random variables. Assume for instance that $V$, $Cl$ and $h_0$ are log-normally distributed. To take this into account, we simply need to insert a section {{Verbatim|[INDIVIDUAL]}} into the project file: | One of the main advantages of $\mlxplore$ is its ability to graphically display the predicted distribution of the functions of interest $Cc$ and $h$ when certain parameters of the model are assumed to be random variables. Assume for instance that $V$, $Cl$ and $h_0$ are log-normally distributed. To take this into account, we simply need to insert a section {{Verbatim|[INDIVIDUAL]}} into the project file: | ||
Line 272: | Line 281: | ||
− | {{ImageWithCaption|image=exploremodel4b.png | + | {{ImageWithCaption|image=exploremodel4b.png|caption=Exploring the statistical model using $\mlxplore$}} |
Line 278: | Line 287: | ||
− | {{ImageWithCaption|image=exploremodel5.png | + | {{ImageWithCaption|image=exploremodel5.png|caption=Exploring the statistical model using $\mlxplore$ }} |
+ | |||
+ | |||
+ | The $\mlxtran$ model files and the $\mlxplore$ scripts can be downloaded here: {{filepath:pk mlxplore.zip}}. | ||
+ | |||
+ | |||
+ | <br> | ||
+ | == Bibliography == | ||
− | {{ | + | <bibtex> |
− | + | @ARTICLE{popixplore, | |
− | + | author = {POPIX Inria team}, | |
+ | title = {Popixplore 1.0}, | ||
+ | url = {https://wiki.inria.fr/wikis/popix/images/7/71/Popixplore_1.1.zip}, | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @ARTICLE{MLXplore, | ||
+ | author = {Lixoft}, | ||
+ | title = {MLXPlore 1.0}, | ||
+ | url = {http://www.lixoft.eu/products/mlxplore/mlxplore-overview}, | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @article{macey2000berkeley, | ||
+ | title={Berkeley Madonna user’s guide}, | ||
+ | author={Macey, R. and Oster, G. and Zahnley, T.}, | ||
+ | journal={Berkeley (CA): University of California}, | ||
+ | year={2000} | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @book{chatterjee2009sensitivity, | ||
+ | title={Sensitivity analysis in linear regression}, | ||
+ | author={Chatterjee, S. and Hadi, A. S.}, | ||
+ | volume={327}, | ||
+ | year={2009}, | ||
+ | publisher={Wiley} | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @book{sensibilité2013, | ||
+ | title={Analyse de sensibilité et exploration de modèles}, | ||
+ | author={Faivre R. and Looss B. and Mahévas, S. and Makowski, D. and Monod, H.}, | ||
+ | year={2013}, | ||
+ | publisher={Editions Quae} | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @book{saltelli2000sensitivity, | ||
+ | title={Sensitivity analysis}, | ||
+ | author={Saltelli, A. and Chan, K. and Scott, E. M. and others}, | ||
+ | volume={134}, | ||
+ | year={2000}, | ||
+ | publisher={Wiley New York} | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @book{saltelli2008global, | ||
+ | title={Global sensitivity analysis: the primer}, | ||
+ | author={Saltelli, A. and Ratto, M. and Andres, T. and Campolongo, F. and Cariboni, J. and Gatelli, D. and Saisana, M. and Tarantola, S.}, | ||
+ | year={2008}, | ||
+ | publisher={Wiley-Interscience} | ||
+ | } | ||
+ | </bibtex> | ||
+ | <bibtex> | ||
+ | @book{saltelli2004sensitivity, | ||
+ | title={Sensitivity analysis in practice: a guide to assessing scientific models}, | ||
+ | author={Saltelli, A. and Tarantola, S. and Campolongo, F. and Ratto, M.}, | ||
+ | year={2004}, | ||
+ | publisher={Wiley} | ||
+ | } | ||
+ | </bibtex> | ||
+ | |||
+ | |||
+ | {{Next | ||
+ | |link=Modeling}} |
Latest revision as of 15:10, 25 June 2013
(If you are experiencing problems with the display of the mathematical formula, you can either try to use another browser, or use this link which should work smoothly: http://popix.lixoft.net)
Contents
Introduction
Before deciding to model data, it is very important to be able to visualize it. This is especially the case for longitudinal data when we want to see how an outcome varies with time or as a function of another outcome. We may also want to visualize how the individual covariates are distributed, visually detect if there are relationships between variables, visually compare data from different groups, etc. Development of such visual exploration tools poses no methodological problems. It is simple to write a Matlab or R code for one's own needs. To illustrate the data visualization part of this chapter, we have created a little Matlab toolbox called $\popixplore$ (https://wiki.inria.fr/wikis/popix/images/7/71/Popixplore_1.1.zip) which can be freely downloaded and used.
It may also be useful to be able to visualize the model itself by undertaking a sensitivity analysis to look at how the structural model changes when we vary one or several parameters. This is important for truly understanding the structural model, i.e., what is behind the given mathematical equations. In the modeling context, we may also want to visually calibrate parameters in order to obtain predictions as close as possible to the observations. Developing such a tool is a difficult task because the tool needs to be able to easily input a model using some coding language, perform complex calculations, and provide a decent graphical interface (e.g., one that lets you easily modify the model parameters).
Various model visualization tools exist, such as Berkeley Madonna, specialized in the analysis of dynamical systems and the resolution of ordinary differential equations. Here, we use $\mlxplore$ for some different reasons:
- $\mlxplore$ uses the $\mlxtran$ language which is extremely flexible and well-adapted to implementing complex mixed-effects models. Indeed, with $\mlxtran$ we can implement pharmacokinetic models with complex administration schedules, include inter-individual variability in parameters, define a statistical model for the covariates, etc. Another extremely important aspect of $\mlxtran$ is that it rigorously adopts the model representation formalisms proposed in $\wikipopix$. In other words, model implementation is completely in sync with its mathematical representation.
- $\mlxplore$ provides a clear graphical interface that of course allows us to visualize the structural model, but also the statistical model, which is of fundamental importance in the population approach. We can thus visualize the impact of covariates and inter-individual variability of model parameters on predictions.
Data exploration
The following example involves 80 individuals that receive a unique dose of an anticoagulant at time $t=0$. For each patient we then measure the plasmatic concentration of the drug at various times. This drug can cause undesirable side effects such as nose bleeds. If this happens, we also record the times at which this happens. The data is recorded in columns of a single text file pkrtte_data.csv. In this example, the columns are:
-
id the ID number of the patient
time dose administration and observation times
amt the amount of drug administered
y the observations (concentrations and events)
ytype the type of observation: 1=concentration, 2=event
weight a continuous individual covariate
gender a categorical individual covariate (F or M)
group four different groups receive different doses: A=40mg, B=60mg, C=80mg, D=100mg.
The datafile pkrtte_data.csv
|
We can read this datafile with the function readdatapx and add additional information about the data:
How we graphically represent data depends on the type of data. Often for continuous data we use "spaghetti plots", where all of the observations are given on the same plot, and those for each individual are joined up using line segments. Time-to-event data are usually represented using Kaplan-Meier plots, i.e., an estimate of the survival function for the first event. In the case of repeated events, we can instead represent the average cumulative number of events per individual.
Graphical representation of the data. Left: concentrations, right: average cumulative number of events per individual
|
When different groups receive different treatments, it can be useful to separately visualize the data from each group. Here for instance we can separate the patients into groups depending on the initial dose given.
Concentration profiles per dose group
|
Distribution of weight and gender per dose group |
Model exploration
Exploring the structural model
Suppose that we now want to visualize the following joint model which is one that can be used for simultaneously modeling PK and time-to-event data:
Here, $A_d$ and $A_c$ are the amounts of drug in the depot and central compartments, $Cc$ the concentration in the central compartment and $h$ the hazard function for the event of interest (hemorrhaging for instance). The parameters of the model are the absorption rate constant $ka$, the volume of distribution $V$, the clearance $Cl$, the baseline hazard $h_0$ and the coefficient $\gamma$. We assume that the drug can be administered both intravenously and orally, meaning that the drug can be administered to both the depot and the central compartment.
We first need to implement this model using $\mlxtran$:
Here, an administration of type 1 (resp. 2) is an oral (resp. iv) administration.
The tasks, i.e., how the model is to be used, are then coded as an $\mlxplore$ project:
In this example, a single dose of 50 mg is administered orally (target=Ad when type=1) at time 0. We have asked $\mlxplore$ to display the predicted concentration $Cc$ and the hazard function $h$ between $t=0$ and $t=100$ every $0.1\,h$ for a given set of parameters. We can then change the values of these parameters with the sliders to see what the impact on the two functions is.
Exploring the model using $\mlxplore$
|
We can easily modify the dose regimen without changing anything in the model itself. Suppose for instance that we want now to compare a treatment with repeated doses of 50mg every 24 hours and a treatment with repeated doses of 25mg every 12 hours. Only the section <DESIGN> needs to be modified:
We can combine different administrations (oral and intravenous for instance) into one global treatment:
Exploring the statistical model
One of the main advantages of $\mlxplore$ is its ability to graphically display the predicted distribution of the functions of interest $Cc$ and $h$ when certain parameters of the model are assumed to be random variables. Assume for instance that $V$, $Cl$ and $h_0$ are log-normally distributed. To take this into account, we simply need to insert a section [INDIVIDUAL] into the project file:
The parameters of the model are now the population parameters $V_{\rm pop}$, $Cl_{\rm pop}$, $h0_{\rm pop}$, $\omega_V$, $\omega_{Cl}$ and $\omega_{h_0}$ and the parameters $k_a$ and $\gamma$ which have no inter-individual variability.
When some parameters of the model are random variables, $\mlxplore$ displays the median of the predicted distribution and several prediction intervals (the default is to use different shaded areas for the 10%, 20%, ..., 90% quantiles).
Exploring the statistical model using $\mlxplore$
|
It is possible to introduce covariates into the statistical model by considering for example that the volume depends on the weight, and considering that these covariates are themselves random variables. This may be important if we are for example looking to visualize the amount of variation in concentration due to variation in weight, and the variation in concentration which remains unaccounted for, caused by random effects.
Exploring the statistical model using $\mlxplore$
|
The $\mlxtran$ model files and the $\mlxplore$ scripts can be downloaded here: https://wiki.inria.fr/wikis/popix/images/c/c6/Pk_mlxplore.zip.
Bibliography
POPIX Inria team - Popixplore 1.0
- https://wiki.inria.fr/wikis/popix/images/7/71/Popixplore_1.1.zip
BibtexAuthor : POPIX Inria team
Title : Popixplore 1.0
In : -
Address :
Date :
Lixoft - MLXPlore 1.0
- http://www.lixoft.eu/products/mlxplore/mlxplore-overview
BibtexAuthor : Lixoft
Title : MLXPlore 1.0
In : -
Address :
Date :
Macey, R., Oster, G., Zahnley, T. - Berkeley Madonna user’s guide
- Berkeley (CA): University of California ,2000
- BibtexAuthor : Macey, R., Oster, G., Zahnley, T.
Title : Berkeley Madonna user’s guide
In : Berkeley (CA): University of California -
Address :
Date : 2000
Chatterjee, S., Hadi, A. S. - Sensitivity analysis in linear regression
- Vol. 327, Wiley,2009
- BibtexAuthor : Chatterjee, S., Hadi, A. S.
Title : Sensitivity analysis in linear regression
In : -
Address :
Date : 2009
Faivre R., Looss B., Mahévas, S., Makowski, D., Monod, H. - Analyse de sensibilité et exploration de modèles
- Editions Quae,2013
- BibtexAuthor : Faivre R., Looss B., Mahévas, S., Makowski, D., Monod, H.
Title : Analyse de sensibilité et exploration de modèles
In : -
Address :
Date : 2013
Saltelli, A., Chan, K., Scott, E. M., others - Sensitivity analysis
- Vol. 134, Wiley New York,2000
- BibtexAuthor : Saltelli, A., Chan, K., Scott, E. M., others
Title : Sensitivity analysis
In : -
Address :
Date : 2000
Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., Saisana, M., Tarantola, S. - Global sensitivity analysis: the primer
- Wiley-Interscience,2008
- BibtexAuthor : Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., Saisana, M., Tarantola, S.
Title : Global sensitivity analysis: the primer
In : -
Address :
Date : 2008
Saltelli, A., Tarantola, S., Campolongo, F., Ratto, M. - Sensitivity analysis in practice: a guide to assessing scientific models