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

posted by Aceto81 – Belgium, 2008-10-03 17:33 (6461 d 17:40 ago) – Posting: # 2473
Views: 89,085

❝ 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
23,653 posts in 4,991 threads, 1,570 registered users;
131 visitors (0 registered, 131 guests [including 20 identified bots]).
Forum time: 11:13 CEST (Europe/Vienna)

To propose that poor design can be corrected by subtle analysis techniques
is contrary to good scientific thinking.    Stuart J. Pocock

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