Spaghetti & other pasta [NCA / SHAM]
❝ […] From your plots, it looks like lin-up/log-down method is more close to actual AUC. In this case, it does no matter what there is any missing data or not. Lin-up/log-down is more accurate than linear, isn't?
I think so. Whatever PK a drug follows, distribution/elimination likely is first order (well, leaving

❝ Weird indeed but very convincible. […] How do you plot the low-right graph? Is it possible to overlap both the lower-left and the lower-right graph as one plot?
Sure. Just interpolate linear within each decreasing segment. Alternatively to lines 12–17 you could set up a function and use
curve()
. Was too lazy.t <- c(0,0.5,0.75,1,1.5,2,2.5,3,4,6,8,16,24)
C <- c(0,69.59,84.64,92.61,96.73,93.45,87.51,
80.85,68.02,47.54,33.17,7.86,1.86)
plot(t, C, type="p", ylim=c(1, max(C)*1.1), log="y", las=1,
main="semilogarithmic", cex.main=1.1,
xlab="time", ylab="concentration")
lines(t, C, col="blue")
for (j in 1:(length(t)-1)) {
if (C[j+1] >= C[j]) {
lines(x=c(t[j], t[j+1]), y=c(C[j], C[j+1]), col="blue")
} else {
tk <- NULL; Ck <- NULL
for (k in seq(t[j], t[j+1], length.out=10)) {
tk <- c(tk, k)
Ck <- c(Ck, C[j]+abs((k-t[j])/(t[j+1]-t[j]))*(C[j+1]-C[j]))
}
lines(tk, Ck, col="red")
}
}
rug(t, side=1)
legend("topright",
c("trapezoidal rules", "linear", "lin-up/log-down"),
lty=c(NA, 1, 1), col=c(NA, "red", "blue"))
![[image]](img/uploaded/image172.png)
If you want to use the code in a linear plot, interpolate logarithmically, i.e., change line 15 to
Ck <- c(Ck, exp(log(C[j])+abs((k-t[j])/(t[j+1]-t[j]))*(log(C[j+1])-log(C[j]))))
❝ Me either. Why do you think that it would be a tough job for commercial software?
I have no experiences with SAS, but in Phoenix/WinNonlin it is tricky indeed.
❝ […] But I don't quite understand why you want to add rug()
plot? We don't have many data points in each subject (usually less than 50's in each period) for a BE/BA study.
It was just an idea to display the sampling schedule. Forget it.

Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- handling of missing data gracehung 2013-05-20 07:35
- Lin-up/log-down trapezoidal avoids most trouble Helmut 2013-05-20 14:22
- Lin-up/log-down trapezoidal avoids most trouble yjlee168 2013-05-22 08:25
- Multiple peaks: fallback to linear trapezoidal Helmut 2013-05-22 20:25
- Multiple peaks: fallback to linear trapezoidal yjlee168 2013-05-22 21:57
- No interpolation Helmut 2013-05-22 23:25
- No interpolation yjlee168 2013-05-23 11:43
- Spaghetti & other pasta Helmut 2013-05-23 15:15
- Spaghetti & other pasta yjlee168 2013-05-23 20:47
- Spaghetti & other pastaHelmut 2013-05-23 21:29
- Spaghetti & other pasta yjlee168 2013-05-23 22:46
- Spaghetti & other pasta Helmut 2013-05-24 01:24
- Spaghetti & other pasta yjlee168 2013-05-24 09:17
- Spaghetti & other pasta Helmut 2013-05-24 01:24
- Spaghetti & other pasta yjlee168 2013-05-23 22:46
- Spaghetti & other pastaHelmut 2013-05-23 21:29
- Spaghetti & other pasta yjlee168 2013-05-23 20:47
- Spaghetti & other pasta Helmut 2013-05-23 15:15
- No interpolation Ken Peh 2013-05-30 19:55
- Different algos! Helmut 2013-05-30 22:38
- Different algos! Ken Peh 2013-06-03 17:52
- Calculate what? Helmut 2013-06-03 18:11
- Different algos! Ken Peh 2013-06-03 17:52
- Different algos! Helmut 2013-05-30 22:38
- No interpolation yjlee168 2013-05-23 11:43
- No interpolation Helmut 2013-05-22 23:25
- Multiple peaks: fallback to linear trapezoidal yjlee168 2013-05-22 21:57
- Lin-up/log-down trapezoidal example Helmut 2013-05-25 15:09
- Lin-up/log-down trapezoidal example yjlee168 2013-05-25 19:45
- Multiple peaks: fallback to linear trapezoidal Helmut 2013-05-22 20:25
- Lin-up/log-down trapezoidal avoids most trouble yjlee168 2013-05-22 08:25
- handling of missing data Ohlbe 2013-05-20 21:45
- Sorry Helmut 2013-05-21 13:53
- Sorry gracehung 2013-05-23 01:06
- Uncertain time point Helmut 2013-05-23 01:35
- Sorry gracehung 2013-05-23 01:06
- Sorry Helmut 2013-05-21 13:53
- Lin-up/log-down trapezoidal avoids most trouble Helmut 2013-05-20 14:22