Unable to obtain AUC
Closed this issue · 1 comments
Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.
If you think that you have found a bug or you have a feature request, please briefly describe your problem and what output you expect.
If you have a question, please ask what you're curious about ideally with expected input, output, and what you have tried (a reprex, if feasible).
Brief description of the problem
I am trying to get auc and also auc at certain interval eg 8hr,12hr for simulated data.
Unfortunately i am getting NA for the AUC. I am not sure what is going wrong.
Data attached and code as below:
simout4 <- dataset.list %>%
filter(TIME!=0 & EVID==0)
Calculate individual PK parameters
param <- simout4 %>%
group_by(DRUG, ID) %>%
arrange(DRUG, ID, as.numeric(TIME)) %>%
summarize(CMAX = max(IPRED),
CMIN = min(IPRED),
AUC6 = pk.calc.auc.last(DV,TIME, interval=c(0, 24)))
please advise
# insert reprex here
Thanks for sharing a reproducible example with your data. The following should work:
library(tidyverse)
library(PKNCA)
d_raw <- read_tsv("dataset.list.txt")
head(d_raw)
# Remove dosing rows
d_conc <-
d_raw |>
filter(EVENT == 1)
o_conc <- PKNCAconc(data = d_conc, DV~TIME|DRUG+ID)
d_intervals <- data.frame(start = 0, end = 24, auclast = TRUE)
o_data <- PKNCAdata(o_conc, intervals = d_intervals)
o_nca <- pk.nca(o_data)
summary(o_nca)
Also, I'm moving this to a discussion since it is more of a question on how to use PKNCA rather than an issue that needs code changes for PKNCA.