Helmut ★★★ ![]() ![]() Vienna, Austria, 2013-07-22 21:14 (4297 d 06:00 ago) Posting: # 11034 Views: 12,168 |
|
Dear NCA-adepts! Following these posts I decided to open a new thread in order to have more space. I payed a closer look at package PK , function lee() . I think that we cannot use it directly, because the last two phases are fit simultaneously – which already might be interpreted as modeling by regulators.I started with my model data set: require(PK) Giving Lee meth. “ols” BP: 11.30, prop. interval: 12.00–24.00 (n= 3) λz: 0.07765 (t½ 8.93) Segmented regression would pick the last four and my eye-balling the last three. For this fantastic data set I got Lee meth. “ols” BP: 11.71, prop. interval: 12.00–24.00 (n= 3) λz: 0.08660 (t½ 8.00) Segmented regression and eye-balling the last three. I rarely read TFM (last time when I beta-tested the package). So I calculated the intersection of the lines based on intercepts and slopes just to find out that there is this nice $chgpt already in the list…What’s happening with a true one-compartment model (t½ 24)? time <- c(0,0.25,0.5,1,2,3,4,5,7,9,11,15,19,25,33,42,55,72) I got Lee meth. “ols” BP: 10.67, prop. interval: 11.00–72.00 (n= 8) λz: 0.02668 (t½ 25.98) Segmented regression tells me to get lost. By eye-balling I would have picked the last five – distracted be the random upshift at 24… Interesting. With the exception of “hub” (Huber M regression) lee() “sees” two distinct phases, even if there is actually only one. TTT performs nicely with the lowest bias.If you want to have a look behind the scenes, try: res <- lee(data1$conc, data1$time, method="…") Anybody ready to run some sim’s? ![]() — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2013-07-23 04:06 (4296 d 23:08 ago) @ Helmut Posting: # 11037 Views: 9,219 |
|
Dear all, after some preliminary sim’s I think the most challenging part is not noise, but coping with lee ’s greedy behavior – fitting two lines more often than necessary. If we feed lee ’s greed we would loose many data points in monophasic profiles (compared to TTT and even more to R²adj). So the problem is: Dampen lee ’s sensitivity but keep it high enough in order to pick true multiphasic profiles. New code (as a function for easier testing):require(PK) Parameters:
lambdaz(time, conc, damp=1.5, hl=24, print=F) The ratios of half lives (with the exception of “hub”, which detected only one phase) are 1.17, 1.20, 1.22. We know from modeling that such small differences are simply impossible to detect with the full arsenal of PK software. In other words: lee ’s ols/lad/npr -methods are crap. So a threshold of 1.5 was already very optimistic. Now for the good news: With the same threshold lee() would still detect two phases in the other two data sets.Of course for a user this is not the way to go. In simulations we should try to find out a value which reliably distinguishes between mono- and multiphasic profiles. This could be the default in your future ‘semi-automatic’ method. If you want to give it a try: Run lambdaz() and use the code from this post to simulate profiles. Change the relevant lines to:n <- 1 # no of sims Call lambdaz(t, C, damp=2, hl=log(2)/k10, print=FALSE) Worked nicely with low bias until I increased the analytical error to 25%. Quite often I was kicked by: Error in lee(data1$conc, data1$time, method = meth[j]) : Ah, the lag-time! Sometimes tmax is at 2.5 and TTT therefore at 5. Leaves only five data point for two phases (or just even four if the LLOQ hits). Since absorption starts at the lagtime, in such cases the subset should not start at 2×tmax, but rather at 2×tmax-tlag. Maybe tomorrow… — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2013-07-23 21:59 (4296 d 05:15 ago) @ Helmut Posting: # 11041 Views: 8,934 |
|
Dear all, TTT is the time of the inflection (tinpt) of the plasma profile (or the minimum of the first derivative = the root of the second derivative). If we have a lagtime, the inflection occurs not at 2×tmax but is shifted by tlag (if you don’t trust me, do some calculus yourself).* Simple example (noise-free data, parameters of this post differing only in lagtimes – 0 and 2): t C1 C2 tmax in green, tinpt in red. Although true elimination is identical we get different estimates because in the second case tinpt is not at 6 but already at 4 (=2×tmax–tlag). Cinpt1=Cinpt2=46.228. Therefore, I suggest to introduce a »TTT’« which corrects for lagtimes and gives similar estimates: TTT’ 2 4 Theoretically AUC∞ should be identical for both profiles (not affected by lagtimes), i.e., 75/0.5+25/0.1–100/2=350. Let’s compare estimated AUCs (by the lin-up/log-down trapezoidal rule): based on TTT AUC∞ 367.19 371.15 With the second algo bias is smaller and similar for both profiles. This is not (only) academic nitpicking, but of practical interest. In the recent MR draft EMA considered the possibility of waiving the multiple dose study if the residual area in single dose (truncated at τ) is <10% of AUC∞. For the lagtime-profile we would get 7.48% (TTT) and 7.14% (TTT’). Does anybody have a clever idea how I can find the lagtime in R without a loop? Essentially I would search backwards from tmax until I find the first NA.
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
martin ★★ Austria, 2013-07-23 22:22 (4296 d 04:52 ago) @ Helmut Posting: # 11042 Views: 8,774 |
|
dear helmut ! Wow; thank you for sharing the code - I will think about some extensive sims when I am back from vacation. best regards martin |
ElMaestro ★★★ Denmark, 2013-07-24 00:35 (4296 d 02:39 ago) @ Helmut Posting: # 11043 Views: 8,838 |
|
Hi Helmut, ❝ Does anybody have a clever idea how I can find the lagtime in R without a loop? Essentially I would search backwards from tmax until I find the first NA. Not thoroughly tested, but if I get your drift, then here's something to consider: time=c(1,2,3,4,5,6,7,8,9,10) Not thoroughly tested though ![]() — Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2013-07-24 03:04 (4296 d 00:10 ago) @ ElMaestro Posting: # 11044 Views: 8,816 |
|
Hi ElMaestro! THX for the code and testing my visual acuity for the second time. ![]() time <- c( 0, 1, 1.5, 2, 4, 5, 6, 7, 8, 9) — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
ElMaestro ★★★ Denmark, 2013-07-24 12:49 (4295 d 14:25 ago) @ Helmut Posting: # 11046 Views: 8,764 |
|
Hi Hötzi, age taking its toll on your eyes ![]() I really like this: ❝ - I had to read the online documentation to understand what which.max actually does.I wonder, how would Tmax be defined in cases of e.g. time <- c( 0, 1, 1.5, 2, 4, 5, 6, 7, 8, 9) - something like that is not entirely uncommon with OIPs, where the plasma levels are annoyingly low and some CROs are really spanking the 5500 (and manipulating the low QC integrations ![]() — Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2013-07-24 16:10 (4295 d 11:04 ago) @ ElMaestro Posting: # 11047 Views: 8,950 |
|
Hi ElMaestro, ❝ age taking its toll on your eyes Sure. I’m a regular guest at my pet doctor. Where do you think I’m getting my pills from? ❝ -I had to read the online documentation to understand what Yeah, some of R’s functions are very efficient but difficult to comprehend. Martin once provided me with a framework full of lapply() , sweep() , aggregate() , simplify2array() , with() , etc. as a wrapper to functions used in sim’s. Speeded up the code at least 10fold. But: I read Cuneiform script more fluent than this gibberish.In my code I use obscure one-liners only in sim’s where speed prevails over clarity. ❝ I wonder, how would Tmax be defined in cases of e.g. ❝ ❝ My code gives: Tmax = 5 Tlag = 1 I’m happy with that. Or would you prefer to flag the 0.01 as crap and come up with a lagtime of 2? BTW, your code comes up with 1.5. ❝ - something like that is not entirely uncommon with OIPs, … Not only with OIPs. We have discussed this issue occasionally (here and there). ❝ … some CROs are really spanking the 5500 Interesting hobby. ❝ … and manipulating the low QC integrations They should not practice BDSM with their machines, but receive bastinado themselves. As a cap’tain you are familiar with the cat o’ nine tails. ![]() Edit: If time[1] is not given and no NAs occur before tmax, my code returns numeric(0), which cannot be used in further calculations.
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |