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

posted by Aceto81 – Belgium, 2008-06-30 17:50 (5768 d 14:26 ago) – Posting: # 1988
Views: 33,097

Hi HS,

the time above MIC was calculated during the Steady State, which goes from 12 hours to 120 hours. That's why the results differs. (I was struggling with this part as well :ponder: ).

Here the updated code:
time <- c(0.5, 1, 3, 5, 8, 12, 24, 36, 48, 60,
          72, 84, 96, 108, 120, 122, 124)
conc <- c(0.64, 0.7, 1.39, 1.35, 0.67, 1.48, 0.32, 2.08, 0.87, 0.93,
          1.09, 0.59, 1.01, 0.47, 0.99, 0.62, 0.13)
dat  <- data.frame(time, conc)

f <- function(dat, th) {
  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)
}

th    <- 0.517
first <- 12
last  <- 120
occupancy <- last-first - f(dat[dat$time >=first & dat$time <=last, ], th)
coverage  <- 100*occupancy/(last-first)
cat(" Time point interval:",first,"-",last,"\n",
    "Occupancy time:",occupancy,"\n",
    "Coverage:",coverage,"%\n")

Thanks for your valuable input

Ace

Complete thread:

UA Flag
Activity
 Admin contact
22,984 posts in 4,822 threads, 1,651 registered users;
45 visitors (0 registered, 45 guests [including 1 identified bots]).
Forum time: 08:17 CEST (Europe/Vienna)

You can’t fix by analysis
what you bungled by design.    Richard J. Light, Judith D. Singer, John B. Willett

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