Calculation of time above MIC [🇷 for BE/BA]

posted by Aceto81 – Belgium, 2008-06-26 23:50 (5775 d 07:23 ago) – Posting: # 1976
Views: 32,704

Dear Helmut,

❝ Actually just start at the beginning of the profile and add all segments which are abobe the MIC up. If the values fall below the MIC and come up again (like in your case) do a linear interpolation. I would use rather R than WinNonlin for that purpose.


Probably I was doing something wrong, maybe sitting too long after the PC, but when I tried this approach, I wasn't even near....

But anyway, with your reply, I started over and finally it works!

Thanks for your help (again)

Ace
PS: for anyone who may find it interesting:

The R code for finding time below the threshold:
"dat" is a dataframe containing column "conc", and "time"
th = threshold
f <- function(dat, th = 0.517) {
  under <- 0
    for (i in which(dat$conc < th)) {
      if (!is.na(dat$conc[i-1])) {
        y <- dat$conc[c(i-1, i)]
        x <- dat$time[c(i-1, i)]
        slope <- coef(lm(y ~ x))[2]
        under <- under + x[2]-x[1]-(th-y[1])/slope
      }
      if (!is.na(dat$conc[i+1])) {
        y <- dat$conc[c(i, i+1)]
        x <- dat$time[c(i, i+1)]
        slope <- coef(lm(y ~ x))[2]
        under <- under + (th-y[1])/slope
      }
    }
  return(under)
}



Edit: Reformatted using BBCodes. [Helmut]

Complete thread:

UA Flag
Activity
 Admin contact
22,987 posts in 4,824 threads, 1,664 registered users;
82 visitors (0 registered, 82 guests [including 10 identified bots]).
Forum time: 07:13 CEST (Europe/Vienna)

The only way to comprehend what mathematicians mean by Infinity
is to contemplate the extent of human stupidity.    Voltaire

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