andrewhooker / PopED

Population Experimental Design (PopED) in R
https://andrewhooker.github.io/PopED/
GNU Lesser General Public License v3.0
33 stars 21 forks source link

Implementation of LLOQ #14

Closed Mark-Tepeck closed 7 years ago

Mark-Tepeck commented 7 years ago

Hi,

Is it possible to implement the low limit of quantification so that the popED consider the drug concentration below as missing value.

Thank you,

Mark,

Monash University

andrewhooker commented 7 years ago

Hi Mark,

Yes, it is. This is, however, a complicated question, and many ways you could approach this problem. See for example https://www.page-meeting.org/default.asp?abstract=2578. Method D2 from this work, although not the best, is the easiest and entails setting the model predictions to zero at the LOQ.

For example:

## Warfarin example from software comparison in:
## Nyberg et al., "Methods and software tools for design evaluation 
##   for population pharmacokinetics-pharmacodynamics studies", 
##   Br. J. Clin. Pharm., 2014. 

library(PopED)

sfg <- function(x,a,bpop,b,bocc){
  ## -- parameter definition function 
  parameters=c(CL=bpop[1]*exp(b[1]),
               V=bpop[2]*exp(b[2]),
               KA=bpop[3]*exp(b[3]),
               Favail=bpop[4],
               DOSE=a[1])
  return(parameters) 
}

ff_d2 <- function(model_switch,xt,parameters,poped.db){
  ##-- Model: One comp first order absorption
  with(as.list(parameters),{
    y=xt
    LOQ = 2
    y=(DOSE*Favail*KA/(V*(KA-CL/V)))*(exp(-CL/V*xt)-exp(-KA*xt))
    y[y<LOQ] <- 0
    return(list(y=y,poped.db=poped.db))
  })
}

feps_d2 <- function(model_switch,xt,parameters,epsi,poped.db){
  ## -- Residual Error function
  ## -- Proportional + additive
  y <- do.call(poped.db$model$ff_pointer,list(model_switch,xt,parameters,poped.db))[[1]] 
  loq_obs <- y==0
  y = y*(1+epsi[,1]) + epsi[,2]
  y[loq_obs] <- 0
  return(list(y=y,poped.db=poped.db)) 
}

## -- Define initial design  and design space
poped_db <- create.poped.database(ff_fun=ff_d2,
                                  fg_file="sfg",
                                  fError_fun=feps_d2,
                                  bpop=c(CL=0.15, V=8, KA=1.0, Favail=1), 
                                  notfixed_bpop=c(1,1,1,0),
                                  d=c(CL=0.07, V=0.02, KA=0.6), 
                                  sigma=c(0.01,0.25),
                                  groupsize=32,
                                  xt=c( 0.5,1,2,6,24,36,72,120),
                                  minxt=0,
                                  maxxt=120,
                                  a=70,
                                  mina=0,
                                  maxa=100)

output <- poped_optim(poped_db, opt_xt = T, parallel = T)
plot_model_prediction(output$poped.db)
Mark-Tepeck commented 7 years ago

Thank you so much.