Tlag - R qualified [NCA / SHAM]
❝ ... but as often before I have an unqualified opinion.
Thanx for that!

❝ ... I do not consider it likely that the true concentration rises to 12 after a <LLOQ and then truly drops back to <LLOQ twice and then skyrockets.
But the only truth I have are the data.
❝ I am thus sure in your dataset random variation plays a role.
Sure with probability almost one!
Random variation as always. Otherwise we would not need any statistics.
❝ If I were a regulator I'd probably have accepted if an applicant argued that lag time should be reflecting the time of the last <LLOQ before the median Tmax .
Interesting suggestion.
BTW: You were my favorite regulator if.
❝ ❝ • Do you know of any software which has implemented such?
❝
❝ You are equipped with the power to write clever scripts ?
As you know I have the POWER TO KNOW.
Here is on. Of course in R (cleverness of code may be improved).
But your suggestion yet not considered because of time.
Should be ELM1.
# DEF1: time prior to (of two consecutive) Conc.>LLOQ
# DEF2: time of the first (of two consecutive) Conc.>LLOQ
# DEF3: mean of Def1 and Def2
fTlag <- function(Ctdata1, method="DEF3", consec=2)
{
#find first of 'consec' consecutive Ct points with Conc>LLOQ (if available)
Ctdata1 <- Ctdata1[!is.na(Ctdata1$Conc),]
n <- length(Ctdata1$time)
if (n<2) return(NA)
Czero <- Ctdata1$Conc[1] # to have it also if multiple dose
# but this should be rare
if (consec<1) consec <- 1
if (consec>3) consec <- 3
Ctdata1$on <- 0
on <- 0
for (i in c(1:n)) {
if (Ctdata1[i,"Conc"]-Czero > 0){
on <- on+1
} else { #Conc=0
if (on>0) on <- 0
}
Ctdata1$on[i] <- on
if (on==consec) break
}
ion1 <- which(Ctdata1$on==1) # indexes with on=1
if (length(ion1)==0) return(NA) # we have no on -> tlag not est.
ion2 <- which(Ctdata1$on==2)
if (length(ion2)==0){
# we have only on=1, may be multiple?
# take the first? or the last?
# take time of maximum Conc?
ion1 <- ion1[1]
t0 <- Ctdata1$time[ion1-1] # time prior to
t1 <- Ctdata1$time[ion1] # time at Conc>LLOQ
} else {
ion3 <- which(Ctdata1$on==3)
if (length(ion3)==0) {
# we have only 2 consec.
ion2 <- ion2[1] # take first if multiple?
t0 <- Ctdata1$time[ion2-2]
t1 <- Ctdata1$time[ion2-1]
} else { # 3 consec. values Conc>0
t0 <- Ctdata1$time[ion2-3]
t1 <- Ctdata1$time[ion2-2]
}
}
tlag <- NA
method <- toupper(method)
if (method=="DEF1") tlag <- t0
if (method=="DEF2") tlag <- t1
if (method=="DEF3") {
if (!is.na(t1)) tlag <- (t1+t0)/2 else tlag <- t0
}
return(tlag)
}
BTW2: How thick is the ice nowadays?
Regards,
Detlew
Complete thread:
- Tlag - subtleties d_labes 2010-03-03 09:23 [NCA / SHAM]
- Tlag - subtleties ElMaestro 2010-03-03 10:49
- Tlag - R qualifiedd_labes 2010-03-03 13:44
- Tlag - subtleties Helmut 2010-03-03 13:55
- Tlag - subtleties d_labes 2010-03-03 14:31
- Tlag - subtleties ElMaestro 2010-03-03 10:49