Spaghetti & other pasta [NCA / SHAM]

posted by Helmut Homepage – Vienna, Austria, 2013-05-23 23:29 (4363 d 14:15 ago) – Posting: # 10633
Views: 19,756

Dear Yung-jin!

❝ […] 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 :party: and Michaelis-Menten aside).

❝ 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]

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]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,667 registered users;
59 visitors (0 registered, 59 guests [including 8 identified bots]).
Forum time: 13:45 CEST (Europe/Vienna)

Patients may recover in spite of drugs or because of them.    John Gaddum

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