lambda_z estimation [🇷 for BE/BA]
Dear Yung-jin,
Thanks for trying my codes with different examples, I learn a lot too.
So here we go:
It looks like the round was not a good idea, this was the reason for the failure of example 2.
For example 3:
So here is the new code, I wraped it up to a function and run your samples through the function:
So for your examples:
ex1:
ex2:
ex3:
This equals to the WinNonlin results (finally....)
Ace
Thanks for trying my codes with different examples, I learn a lot too.
So here we go:
It looks like the round was not a good idea, this was the reason for the failure of example 2.
For example 3:
nrow(dat)-3:nrow(dat)
gives 4 rows, instead of 3, so the code wasn't able to pick less than 4 points.So here is the new code, I wraped it up to a function and run your samples through the function:
f<- function(dat) {
n_lambda=0
r.adj=0
for (i in (nrow(dat)-2):(which.max(dat$conc+1))) {
if (r.adj - summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared <
(0.0001)) {
n_lambda <- nrow(dat)-i+1
r.adj <- summary(lm(log(conc)~time,dat[i:nrow(dat),]))$adj.r.squared
}
}
return(n_lambda)
}
So for your examples:
ex1:
b<-c(0,0.25,0.5,0.75,1,1.5,2,3,4,8,12,24)
c<-c(0,36.1,125,567,963,1343,1739,1604,1460,797,383,72)
dat <- data.frame(time=b,conc=c)
f(dat)
[1] 5
ex2:
b<-c(0,0.25,0.5,0.75,1,1.5,2,3,4,8,12,24)
d<-c(0,84.5,192,629,873,1246,1633,1375,1006,616,379,84.4)
dat <- data.frame(time=b,conc=d)
f(dat)
[1] 4
ex3:
b<-c(0,0.5,0.75,1,1.5,2,3,4,8,12,24)
c<-c(0,69.7,167,602,1023,1388,1481,1346,658,336,84)
dat <- data.frame(time=b,conc=c)
f(dat)
[1] 3
This equals to the WinNonlin results (finally....)
Ace
Thread locked
Complete thread:
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-12 20:53 [🇷 for BE/BA]
- bear v1.0.0 for R - first impressions Helmut 2008-07-14 04:12
- bear v1.0.0 for R - first impressions yjlee168 2008-07-14 10:26
- bear v1.0.0 for R - first impressions Helmut 2008-07-14 14:02
- bear v1.0.0 for R - first impressions yjlee168 2008-07-14 18:12
- bear v1.0.0 for R... Helmut 2008-07-14 18:56
- bear v1.0.0 for R... yjlee168 2008-07-14 19:30
- bear v1.0.0 for R... Helmut 2008-07-14 20:35
- bear v1.0.0 for R... yjlee168 2008-07-14 19:30
- bear v1.0.0 for R... Helmut 2008-07-14 18:56
- bear v1.0.0 for R - first impressions yjlee168 2008-07-15 09:44
- bear v1.0.0 for R - first impressions yjlee168 2008-07-14 18:12
- bear v1.0.0 for R - first impressions Helmut 2008-07-14 14:02
- bear v1.0.0 for R - first impressions yjlee168 2008-07-14 10:26
- bear v1.0.0 - a data analytical tool for ABE in R martin 2008-07-14 12:18
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-14 19:02
- bear v1.0.0 - a data analytical tool for ABE in R Aceto81 2008-07-15 10:07
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-16 07:22
- bear v1.0.0 - a data analytical tool for ABE in R Aceto81 2008-07-16 09:47
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-16 21:32
- bear v1.0.0 - a data analytical tool for ABE in R Aceto81 2008-07-16 09:47
- lambda_z estimation yjlee168 2008-09-23 12:13
- lambda_z estimation d_labes 2008-09-23 14:41
- lambda_z estimation yjlee168 2008-09-24 22:41
- lambda_z estimation Aceto81 2008-09-25 10:56
- lambda_z estimation yjlee168 2008-09-25 21:00
- lambda_z estimation yjlee168 2008-09-26 08:03
- lambda_z estimationAceto81 2008-09-26 10:25
- lambda_z estimation yjlee168 2008-09-28 00:08
- lambda_z estimation yjlee168 2008-09-29 13:32
- WinNonlin 5.2.1 vs. 6 beta Helmut 2008-09-29 15:54
- WinNonlin 5.2.1 vs. 6 beta yjlee168 2008-09-29 18:45
- WinNonlin 5.2.1 vs. 6 beta --> new finding yjlee168 2008-09-30 08:10
- Example 4 in SASophylistic d_labes 2008-09-30 09:43
- Example 4 in SASophylistic yjlee168 2008-09-30 12:23
- Example 4 in SASophylistic d_labes 2008-09-30 09:43
- WinNonlin 5.2.1 vs. 6 beta Helmut 2008-09-29 15:54
- lambda_z estimationAceto81 2008-09-26 10:25
- TTT method for lambda_z estimation yjlee168 2008-09-30 12:34
- TTT method for lambda_z estimation d_labes 2008-09-30 14:48
- TTT method for lambda_z estimation yjlee168 2008-09-30 20:28
- TTT method plus best fit combined d_labes 2008-10-01 08:43
- AIC or ARS as the best fit criterion? yjlee168 2008-10-02 12:40
- AIC or ARS as the best fit criterion? d_labes 2008-10-02 13:59
- AIC or ARS as the best fit criterion? yjlee168 2008-10-02 12:40
- TTT method plus best fit combined d_labes 2008-10-01 08:43
- TTT method for lambda_z estimation yjlee168 2008-09-30 20:28
- TTT method for lambda_z estimation Aceto81 2008-09-30 15:11
- TTT method for lambda_z estimation yjlee168 2008-09-30 19:57
- TTT method for lambda_z estimation Aceto81 2008-10-01 14:18
- TTT method for lambda_z estimation yjlee168 2008-10-02 12:29
- TTT method for lambda_z estimation Aceto81 2008-10-03 15:33
- TTT method for lambda_z estimation yjlee168 2008-10-03 21:22
- TTT method for lambda_z estimation Aceto81 2008-10-03 15:33
- TTT method for lambda_z estimation yjlee168 2008-10-02 12:29
- TTT method for lambda_z estimation Aceto81 2008-10-01 14:18
- TTT method for lambda_z estimation yjlee168 2008-09-30 19:57
- TTT method for lambda_z estimation d_labes 2008-09-30 14:48
- lambda_z estimation d_labes 2008-09-23 14:41
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-16 07:22
- bear v1.0.0 - a data analytical tool for ABE in R Aceto81 2008-07-15 10:07
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-14 19:02
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-07-22 14:35
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-23 09:55
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-07-24 10:04
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-25 20:38
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-07-28 08:42
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-25 20:38
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-23 16:10
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-09-24 22:00
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-25 09:03
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-25 13:52
- bear v1.0.0 - a data analytical tool for ABE in R Helmut 2008-09-25 14:39
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-25 14:55
- bear v1.0.0 - a data analytical tool for ABE in R Helmut 2008-09-25 15:33
- GLM in R and the power to know d_labes 2008-09-25 16:45
- GLM in R and the power to know ElMaestro 2008-09-25 19:23
- nesting in R? yjlee168 2008-09-25 20:49
- nesting in R? ElMaestro 2008-09-25 22:01
- lm in R Helmut 2008-09-26 00:23
- nesting in R? yjlee168 2008-09-25 20:49
- GLM in R and the power to know ElMaestro 2008-09-25 19:23
- GLM in R and the power to know d_labes 2008-09-25 16:45
- bear v1.0.0 - a data analytical tool for ABE in R Helmut 2008-09-25 15:33
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-25 14:55
- bear v1.0.0 - a data analytical tool for ABE in R Helmut 2008-09-25 14:39
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-25 13:52
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-09-25 09:03
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-09-24 22:00
- bear v1.0.0 - a data analytical tool for ABE in R ElMaestro 2008-07-24 10:04
- Type III SS in balanced, crossover BE studies? yjlee168 2008-10-18 21:03
- Type III SS in balanced, crossover BE studies? ElMaestro 2008-10-21 13:09
- Type III SS in balanced, crossover BE studies? yjlee168 2008-10-21 13:19
- Only balanced, crossover BE studies? d_labes 2008-10-21 14:31
- Only balanced, crossover BE studies? yjlee168 2008-10-21 19:01
- Only balanced, crossover BE studies? ElMaestro 2008-10-24 11:26
- Thread locked Helmut 2008-10-24 11:58
- Only balanced, crossover BE studies? ElMaestro 2008-10-24 11:26
- Only balanced, crossover BE studies? yjlee168 2008-10-21 19:01
- Only balanced, crossover BE studies? d_labes 2008-10-21 14:31
- Type III SS in balanced, crossover BE studies? yjlee168 2008-10-21 13:19
- Type III SS in balanced, crossover BE studies? ElMaestro 2008-10-21 13:09
- bear v1.0.0 - a data analytical tool for ABE in R yjlee168 2008-07-23 09:55
- bear v1.0.0 for R - first impressions Helmut 2008-07-14 04:12