Winbugs Seminar - University of Cambridge

Download Report

Transcript Winbugs Seminar - University of Cambridge

Oct2001
NOVARTIS
WinBugs with some PK examples
Peter Blood
CP-Bios
Novartis Horsham Research Centre
winBUGS
Slide 1
Oct2001
NOVARTIS
Examples
• IV dose
- Cadralazine
• Oral 1 compartment
– Theophylline
winBUGS
Slide 2
Oct2001
NOVARTIS
A Simple Hierarchical Structure
phi
et a1
t het a
l o g ( Cl )
et a2
l o g ( V)
mu
conc
f or ( j
f or ( i
I N 1 :
I N 1 :
11)
12)
winBUGS
Slide 3
Oct2001
NOVARTIS
IV - Cadralazine
• Taken IV by patients for cardiac failure
• Data consisted of 10 patients on 30mg
• Original Bayesian analysis by Wakefield, RacinePoon et al
• (Applied Statistics 43,No 1, pp201-221,1994)
• Analysed in BUGS with a linearised model
– See version 0.6 manual addendum
• Can now be analysed with nonlinear Model in
PkBUGS
• Will consider a non-linear model with winBUGS
winBUGS
Slide 4
Oct2001
NOVARTIS
Cadralazine Data (from Wakefield et al)
Concentration (mg/L)
1.9
1.4
0.9
0.4
-0.1
0
5
10
15
Time (h)
20
25
30
winBUGS
Slide 5
Oct2001
NOVARTIS
IV Cadralazine Equation
Conc  A exp(bt )
Clt
D
)
Conc  exp(
V
V
substituting
log(V);   log(Cl)
winBUGS
Slide 6
Oct2001
NOVARTIS
Cadralazine Models
• Analysed in BUGS v0.6 as product formulation of the
bivariate nomal
• Log V ~ N(ua, a) I (La,Ua)
• Log Cl | log V ~ N(k0+k1(Log V - c), b) I(Lb,Ub)
• Could now analyse in winBUGS 1.3 as multivariate
• muab [1:2] ~ dmnorm(mean[1:2], prec[1:2,1:2])
• tauab[1:2,1:2] ~ dwish(R[1:2], 1:2],2)
• Could now use PKBUGS (see David Lunn’s example)
winBUGS
Slide 7
Oct2001
NOVARTIS
Cadralazine Doodle
n a me :
mn [ i , j ]
val ue:
( Do s e / e x p ( l g v o l [ i ] ) ) * e x p ( - t [ j ] * e x p ( l g c l [ i ] - l g v o l [ i ] ) )
t ype:
p. l gvol
l ogi cal
l i nk:
t au. vol
i dent i t y
p. l gcl
l gvol [ i ]
Do s e
t au. cl
l gcl [ i ]
mn [ i , j ]
t auC
Y[ i , j ]
f or ( j
f or ( i
I N 1 :
I N 1 :
N)
K)
winBUGS
Slide 8
Oct2001
NOVARTIS
Cadralazine Results
Mean
(sd)
BUGS 0.6
winBUGS
PKBUGS
p.lgcl
1.051(0.147)
1.061 (0.131)
1.054 (0.129)
p.lgvol
2.838 (0.072)
2.669 (0.043)
2.683 (0.056)
tauC
-
285.9 (52.96)
232.8 (51.18)
sigma
-
0.060 (0.006)
0.066 (0.007)
winBUGS
Slide 9
Oct2001
NOVARTIS
Theophylline Example
•
•
•
•
•
Bronchodilator (methyl xanthine)
Kinetics of drug’s anti-asthmatic properties
12 Subjects measured 11 times over 25 hours
Oral first order one compartment model
First Analysed by Sheiner and Beal with
NONMEM
• Also by Pinherio and Bates in S+ using NLME
• And in SAS using proc NLMIXED
winBUGS
Slide 10
Oct2001
NOVARTIS
References on Theophylline
•
•
•
Davidian & Giltinan 1995
–
“Non linear Models for Repeated
–
Measurement Data”, pub Chapman & Hall.
Pinheiro & Bates (1995)
–
Analysed in SAS (Proc Nlmixed)
–
Reanalysed in SPLUS (NLME)
Boeckman, Sheiner & Beal 1992
–
(Nonmem User’s Guide Part V)
–
Created with Body weight as a Cl covariate
–
Absorption assumed same for all subjects
–
1 Compartment model
–
Volume in L/kg, Clearance in L/hr/kg
winBUGS
Slide 11
Oct2001
NOVARTIS
Theophylline Example
12 adults from NONMEM file
100.0
1
10
10.0
11
12
2
3
4
1.0
5
6
7
8
9
0.1
0
5
10
15
20
25
time (hour)
winBUGS
Slide 12
Oct2001
NOVARTIS
Theophylline Example
NONMEM dataset (12 adults)
100.0
1
10
11
10.0
12
2
3
4
1.0
5
6
7
8
9
0.1
0.1
1.0
10.0
100.0
time (hour)
winBUGS
Slide 13
Oct2001
NOVARTIS
Open Oral Model for Theophylline
Dka
Conc 
{exp(Clt / V)  exp(Kat)}
(Vka  Cl)
substituting
  log(V);   log(Cl);
winBUGS
Slide 14
Oct2001
NOVARTIS
Theophylline Central Code
• for(i in 1:nSUBJ){
•
for(j in 1:nTIME){
•
mu[i,j] <- Dose[i]*exp(logka)*
•
(exp((-Time[i,j])*exp(lgcl[i]-lgvol[i]))
•
- exp((-Time[i,j])*exp(logka)))
•
/(exp(lgvol[i]+logka)-exp(lgcl[i]))
•
Conc[i,j] ~ dnorm(mu[i,j], epsilon)
•
}# end of j time loop
• }# end of i subject loop
• Conc[i,j] ~ dt(mu[i,j],epsilon,4)
winBUGS
Slide 15
Oct2001
NOVARTIS
Prior Information
•
•
•
•
•
•
phi
theta
logka
eta1
eta2
epsilon
~
~
~
~
~
~
dnorm(-3.5, 500)
dnorm(-1,100000)
dnorm( 0.5, 150)
dgamma(40, 1)
dgamma(12, 3)
dgamma(0.001,0.001)
# log(Cl)
# log(V)
# inter
# inter
# intra
• for(i in 1:nSUBJ){
•
lgcl[i] ~ dnorm(phi,eta1)
•
lgvol[i] ~ dnorm(theta,eta2)
•
winBUGS
Slide 16
Oct2001
NOVARTIS
Initial Conditions (1st)
• # 1st set of initial start conditions
• list(phi
= -4.0,
•
theta = -1.5,
•
logka = 0.3,
•
eta1
= 24,
•
eta2
= 2,
•
epsilon= 0.7,
•
lgcl
= c(-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,
•
-4.0,-4.0,-4.0,-4.0,-4.0,-4.0),
•
lgvol = c(-1.5,-1.5,-1.5,-1.5,-1.5,-1.5,
•
-1.5,-1.5,-1.5,-1.5,-1.5,-1.5)
• )
winBUGS
Slide 17
Oct2001
NOVARTIS
Data Collection & Posterior Statistics
• for(i in 1:nSUBJ){
•
Dose[i]
<- Z[i,1,4]
•
for(j in 1:nTIME){
•
Time[i,j] <- Z[i,j,5]
•
Conc[i,j] <- Z[i,j,6]
•
•
•
•
•
lgcl.mn
lgvol.mn
mnCl
mnVol
Sigma
<<<<<-
mean(lgcl[])
mean(lgvol[])
exp(lgcl.mn)
exp(lgvol.mn)
1.0/sqrt(epsilon)
• for(i in 1:nSUBJ){
•
Cl[i]
<- exp(lgcl[i])
•
Vol[i]
<- exp(lgvol[i])
winBUGS
Slide 18
Oct2001
NOVARTIS
Theophylline Data-1st Subject
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
list(nSUBJ = 12, nTIME = 11,
Z = structure(
.Data=c(
1, 1, 79.60, 4.02, 0.00, 0.74,
2, 1, 79.60, 4.02, 0.25, 2.84,
3, 1, 79.60, 4.02, 0.57, 6.57,
4, 1, 79.60, 4.02, 1.12,10.50,
5, 1, 79.60, 4.02, 2.02, 9.66,
6, 1, 79.60, 4.02, 3.82, 8.58,
7, 1, 79.60, 4.02, 5.10, 8.36,
8, 1, 79.60, 4.02, 7.03, 7.47,
9, 1, 79.60, 4.02, 9.05, 6.89,
10, 1, 79.60, 4.02,12.12, 5.94,
11, 1, 79.60, 4.02,24.37, 3.28,
............
132,12, 60.50, 5.30,24.15, 1.17), .Dim=c(12,11,6)))
winBUGS
Slide 19
Oct2001
NOVARTIS
Start of 2 chains for log(Cl)
(Theophylline)
l g c l . mn c h a i n s 2 : 1
- 3. 0
- 3. 5
- 4. 0
0
50
i t er at i on
winBUGS
Slide 20
Oct2001
NOVARTIS
3rd Continuation of chains for log(Cl)
(Theophylline)
-
l g c l . mn c h a i n s 2 : 1
3. 2
3. 3
3. 4
3. 5
3. 6
8850
8900
8950
i t er at i on
winBUGS
Slide 21
Oct2001
NOVARTIS
History Chains
(Theophylline)
l g c l . mn c h a i n 1
- 3. 2
- 3. 3
- 3. 4
- 3. 5
- 3. 6
4001
5000
7500
10000
i t er at i on
12500
7500
10000
i t er at i on
12500
l g c l . mn c h a i n 2
- 3. 2
- 3. 3
- 3. 4
- 3. 5
- 3. 6
4001
5000
winBUGS
Slide 22
Oct2001
NOVARTIS
Results for Theophylline
•
node
•
•
•
•
•
•
•
•
•
epsilon
eta1
eta2
Lgcl.mn
Lgvol.mn
Logka
Phi
Theta
sigma
mean sd
0.891
36.34
4.734
-3.352
-0.719
0.483
-3.432
-0.999
1.067
0.124
6.035
1.124
0.045
0.028
0.056
0.039
0.003
0.075
MC err start
sample
0.0016
0.0672
0.0085
0.0011
0.0007
0.0013
0.0006
0.00002
0.0009
20000
20000
20000
20000
20000
20000
20000
20000
20000
4001
4001
4001
4001
4001
4001
4001
4001
4001
winBUGS
Slide 23
Oct2001
NOVARTIS
Geweke & Cross-Correlation
(chain 1)
Geweke
(Z)
Variable
Lgcl.mn
0.608
Lgcl.mn
1.000
-1.500
Lgvol.mn
Phi
Theta
Lgvol.mn -0.488
1.000
Phi
0.525
-0.252
1.000
-0.882
Theta
0.002
-0.013
-0.001
1.000
-0.611
Sigma
-0.211
0.125
-0.102
0.005
1.080
Sigma
1.000
winBUGS
Slide 24
Oct2001
NOVARTIS
Multivariate Theophylline
• # vague prior information
• muab[1:2]
~ dmnorm(mean[1:2],precn[1:2,1:2])
• tauab[1:2,1:2] ~ dwish(omega[1:2,1:2],2)
•
•
•
•
•
# extra initial conditions
list(
mean
= c(0,0),
precn = structure(.Data=c(1.0E-6,0,0,1.0E-.Dim=c(2,2)),
omega = structure(.Data=c(0.1,0,0,0.01), .Dim=c(2,2)))
winBUGS
Slide 25
Oct2001
NOVARTIS
Results from Multi-variate Model
(Theophylline)
• node
•
•
•
•
•
•
•
•
•
epsilon
Logka
muab[1]
muab[2]
Sigma
tauab[1,1]
tauab[1,2]
tauab[2,1]
tauab[2,2]
mean sd
0.937
0.463
-3.259
-0.738
1.041
17.740
-5.524
-5.524
32.080
0.130
0.058
0.102
0.072
0.073
11.30
11.50
11.50
21.60
MC err start
sample
0.0018
0.0014
0.0015
0.0009
0.0010
0.2633
0.2628
0.2628
0.4639
20000
20000
20000
20000
20000
20000
20000
20000
20000
4001
4001
4001
4001
4001
4001
4001
4001
4001
winBUGS
Slide 26
Oct2001
NOVARTIS
Theophylline
Software
RESULTS
Log(ka)
Log(V)
LOG(Cl)
winBUGS M-H
0.482
-0.999
-3.432
NONMEM Taylor
0.456
-0.802
-3.160
S+
NLME
0.453
-0.782
-3.214
SAS
NLMIXED
0.453
-0.795
-3.169
SAS
NLMIXED
0.481
Davidian
& Giltian
“
GTS
0.265
-0.795
-3.207
V&C GLS
0.453
-0.748
-3.264
L&B GLS
0.329
-0.789
-3.214
“
Procedure
-3.227
LOG(Ke)
-2.459
winBUGS
Slide 27
Oct2001
NOVARTIS
Conclusions
•
•
•
•
•
Run some examples of PK models in winBUGS.
IV and Oral One compartment examples.
Cadralazine and Theophylline
Compared with results from other sources
Looked at convergence issues in CODA
• Perhaps you should now try PKBUGS (28models)!
• Plea for further development of PKBUGS
winBUGS
Slide 28
Oct2001
NOVARTIS
The End
• Any
•Questions
• ?
winBUGS
Slide 29