example [🇷 for BE/BA]

posted by martin  – Austria, 2008-10-16 22:02 (6463 d 21:30 ago) – Posting: # 2547
Views: 26,475

dear ace !

here is a rather strange (artificial) example generated in a simulation study (R version 2.6.2 for windows XP)

best regards

martin

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)

# without fishing for NA's
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])))
 {
   check <- summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared #modification
   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
   }
}

# fishing for NA's
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])))
 {
   check <- summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared #modification
   if (!is.na(check) && (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
   }
}

Complete thread:

UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,571 registered users;
367 visitors (0 registered, 367 guests [including 18 identified bots]).
Forum time: 19:33 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