Sunday, March 2, 2014

Simple Pharmacokinetics with Jags

In this post I want to analyze a first order pharmocokinetcs problem: the data of study problem 9, chapter 3 of Rowland and Tozer (Clinical pharmacokinetics and pharmacodynamics, 4th edition) with Jags. It is a surprising simple set of data, but still there is enough to play around with.

Data, model and analysis

The data is simple enough. One subject's concentration of cocaine (μg/L) in plasma as function of time, after a starting dose of 33 mg cocaine hydrochlorine. The model is simple enough, C=C0*exp(-k*t). A number of additional parameters are to be calculated, half-live (t1/2), Clearance (CL) and distribution volume (V). Additional information needed; molecular weight of cocaine 303 g/mol, cocaine hydrochloride 330 g/mol.ch3sp9 <- data.frame( time=c(0.16,0.5,1,1.5,2,2.5,3), conc=c(170,122,74,45,28,17,10))

DIC is an estimate of expected predictive error (lower deviance is better).

The results are fairly close to the first calculation, although the standard deviations are a bit larger. The question which is the better obviously depends on the expectations or knowledge on measurement error. The book states the data is adapted from a paper (Chow et al., 1985, link to pdf), but that did not help me for this question.

Looking at residuals

I find classic regression to be a bit more convenient to help me with the structure of the error.

l1 <- lm(log(conc) ~ time,data=ch3sp9)

l1

Call:

lm(formula = log(conc) ~ time, data = ch3sp9)

Coefficients:

(Intercept) time

5.2994 -0.9922

n1 <- nls(conc~c0*(exp(-k*time)),

data=ch3sp9,

start=c(k=0.1,c0=120))

n1

Nonlinear regression model

model: conc ~ c0 * (exp(-k * time))

data: ch3sp9

k c0

0.9878 199.2918

residual sum-of-squares: 0.5369

Number of iterations to convergence: 5

Achieved convergence tolerance: 1.809e-07

par(mfrow=c(2,2))

plot(l1)

par(mfrow=c(1,1))

plot(x=predict(n1),y=resid(n1),main='nonlinear')

To me the non-linear model seems to have somewhat better behaving residuals.

Using a package

The package PKfit does offer these calculations. It is also completely menu operated, hence no code in this blog part. It does offer the possibility to specify error as shown here.

No comments:

Post a Comment

Wiekvoet

Wiekvoet is about R, JAGS, STAN, and any data I have interest in. Topics range from sensometrics, statistics, chemometrics and biostatistics. For comments or suggestions please email me at wiekvoet at xs4all dot nl.