TTT method for lambda_z estimation [🇷 for BE/BA]

posted by Aceto81 – Belgium, 2008-10-03 17:33 (5682 d 17:47 ago) – Posting: # 2473
Views: 55,660

❝ Yes, we've been planning to do that just following what you've proposed here.

❝ Thank you so much for always being so helpful.


Hello,

if I've got some time, I'm happy to help you.
As for the selection of number of points used, I wrote a quick function, which gives you an overview:
f <- function(dat){
  m <- which.max(dat$conc)
  f2 <-  function(m) return(cbind((nrow(dat)-m+1),abs(extractAIC(lm(log(conc)~time,dat[m:nrow(dat),])))[2],summary(lm(log(conc)~time,dat[m:nrow(dat),]))$adj.r.squared))
  overview <- as.data.frame(do.call(rbind,lapply((m+1):(nrow(dat)-2),f2)))
  names(overview) <- c("n","AIC","adjR2")
  n_ARS=0
  r.adj=0
  for (i in (nrow(dat)-2):(which.max(dat$conc)+1)) {
    if (r.adj - summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared <(0.0001)) {
      n_ARS = nrow(dat)-i+1
      r.adj = summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared
      }
    }   

  n_TTT_ARS=0
  r.adj2=0
  for (i in (nrow(dat)-2):(min(seq_along(dat$time)[dat$time>=dat$time[which.max(dat$conc)]*2]))) {
    if (r.adj2 - summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared <(0.0001)) {
      n_TTT_ARS = nrow(dat)-i+1
      r.adj2 = summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared
    }
  }   

  require(PK)
  l <- lee(conc=dat$conc, time=dat$time)
  n_lee <- sum(dat$time> l$chgpt)
  n_TTT <- sum(dat$time> (dat$time[which.max(dat$conc)]*2))
  n_AIC <- overview$n[which.min(abs(overview$AIC))]   plot(l,log="y")
  print(overview)
  cat("\n")
  return(data.frame(TTT=n_TTT, AIC=n_AIC, ARS=n_ARS,TTT_ARS=n_TTT_ARS,lee=n_lee))
}

The code makes an comparison between TTT, AIC criterium, ARS, the combination of TTT and ARS and the lee (although sometimes lee doesn't work according to the lt parameter set).

You can adjust the lee parameters by typing it into the function eg. f(dat,lt=TRUE, method="ols")

Maybe it's helpfull for you

Ace
Thread locked

Complete thread:

UA Flag
Activity
 Admin contact
22,993 posts in 4,828 threads, 1,655 registered users;
98 visitors (1 registered, 97 guests [including 2 identified bots]).
Forum time: 11:20 CEST (Europe/Vienna)

Never never never never use Excel.
Not even for calculation of arithmetic means.    Martin Wolfsegger

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5