# Calculating AUC using the R package PK

Pharmacokinetic (PK) studies aim to understand the kinetics of absorption, distribution, metabolism, and elimination (ADME) of a drug in the body. PK studies typically involve measuring the concentration of the drug in the plasma or blood at several time points post drug administration.

Thomas Jaki and Martin Wolfsegger “Estimation of pharmacokinetic parameters with the R package PK” Pharmaceutical Statistics (2010)

Rodent in vivo toxicology studies are initiated and completed prior to clinical PK studies in humans. Drug exposure is measured by the area under the concentration x time curve (area under the curve [AUC]) or maximum concentration (Cmax) at the expected peak concentration time (Tmax).

For large animals, each animal is usually sampled per time point giving rise to a complete design. For rats and mice, people usually have serial sampling, where only one sample per subject is available, or batch or sparse sampling, where more than one sample (but not the complete time course) is available from the animal. In the latter case, calculation of AUC and its standard error is not easy.

Nusrat Rabbee “Biomarker Analysis in Clinical Trials with R” (2020)

The R package PK helps you calculate them.

The example dataset is a single-oral-dose toxicokinetic study using female rats. It contains the concentration of a drug in the plasma at the predefined time points. The treatment groups are six different doses of an experimental compound. Each treatment group are composed of three batches of three animals. Area under the plasma curve are calculated from hour 0 to hour 24 using the trapezoidal rule and assuming a plasma value of 0 at hour 0 (just prior to dosing) for all animals.

Daniel Holder et al. “A method for estimating and testing area under the curve in serial sacrifice, batch, and complete data designs” Journal of Biopharmaceutical Statistics (1999)

``````library(PK)
data(Rats)
``````A data.frame: 6 × 4
id	conc	time	dose
<int>	<dbl>	<dbl>	<dbl>
1	1	0.00	0	100
2	2	0.00	0	100
3	3	0.00	0	100
4	1	1.75	1	100
5	2	2.20	1	100
6	3	1.58	1	100``````

``````data1 <- subset(Rats, Rats\$dose==100)
data2 <- subset(Rats, Rats\$dose==300)
res1 <- auc(data=data1, method='t', design='batch')
res2 <- auc(data=data2, method='t', design='batch')
plot(res1, col='black', ylim=c(0,8), xlim=c(0,25))
legend(x=0, y=8, xjust=0, lty=1, col=c('black','red'),
legend=c('Dose of 100', 'Dose of 300'))``````
``````data3 <- subset(Rats, Rats\$dose==100 | Rats\$dose==300)
data3\$group <- data3\$dose
res3 <- auc(data=data3, method='t', design='batch')
plot(res3, bygroup=TRUE)``````

You can produce the two-sided confidence interval for the dose of 100 mg.

``````data <- subset(Rats, Rats\$dose==100)
auc.tlast <- auc(data=data, method=c('z','t'), design='batch')
auc.tlast``````
``````Estimation for a batch design

Estimate   SE      95% t-CI
AUC to tlast    39.47 7.31 (14.94;64.00)

Estimate   SE      95% z-CI
AUC to tlast    39.47 7.31 (25.14;53.80)``````

You can obtain each value by outputting the dataframe by running this:

``auc.tlast\$CIs``

Share
masaFollow Enjoy Lifescience