example [🇷 for BE/BA]

posted by Aceto81 – Belgium, 2008-10-17 14:30 (6463 d 07:57 ago) – Posting: # 2548
Views: 26,803

Dear Martin,

Thanks for the example!
The reason for the NA is the fact that the program was only selecting 2 samples, instead of the minimum of 3.
This was caused by the fact that there were 2 samples after 2x Tmax.
So infact this should return an NA for the method I think (correct me if I'm wrong).

Here is an implementation:

time <- c(0.08263463, 0.52824754, 1.17358567, 1.39767757, 2.47663194,  3.19031555, 3.97925368, 6.95466074, 7.42732263, 12.08734425, 12.35692940, 13.63305248, 21.64587886, 29.33632297)
conc <- c(1.175213, 8.748377, 12.650698, 12.741200, 12.965722, 13.648985, 13.633996, 11.110552, 16.232875, 6.747145, 7.156791, 7.776978, 3.241740, 1.528261)

dat <- data.frame(time=time, conc=conc)

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


Ace

Complete thread:

UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,571 registered users;
380 visitors (0 registered, 380 guests [including 18 identified bots]).
Forum time: 22:28 CEST (Europe/Vienna)

The real struggle is not between the right and the left
but between the party of the thoughtful
and the party of the jerks.    Jimmy Wales

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