Clinical PK/PD

DV_PRED_IPRED

最終更新:

hks

- view
だれでも歓迎! 編集

DV, PRED, IPRED の重ね描き


plot.ipred <-
function(
  tab, ID="ID", DV="DV", IPRE="IPRE",
  layout=c(3, 3),
  xlab="Time (hr)", ylab="Concentration (ng/mL)",
  ...
) {
  tab.plot <- rbind(
    data.frame(type=rep(1, nrow(tab)), ID=tab[,ID], TIME=tab$TIME, Y=tab$DV),
    data.frame(type=rep(2, nrow(tab)), ID=tab[,ID], TIME=tab$TIME, Y=tab$PRED),
    data.frame(type=rep(3, nrow(tab)), ID=tab[,ID], TIME=tab$TIME, Y=tab[,IPRE])
  )
  
  res <- xyplot(Y ~ TIME | factor(ID), tab.plot,
    type=tab.plot$type,
    layout=layout,
    xlab=xlab, ylab=ylab,
    panel=function(x, y, subscripts, type=type) {
      panel.xyplot(x[type[subscripts]==1], y[type[subscripts]==1], col.symbol=1)
      panel.xyplot(x[type[subscripts]==2], y[type[subscripts]==2], type="l", col.line=1)
      panel.xyplot(x[type[subscripts]==2], y[type[subscripts]==3], type="l", col.line=4)
    },
    ...
  )
  res
}

plot.ipred(tab[tab$MDV==0,], ID="SID", ylab="Plasma concentration (ng/mL)")

タグ:

R
+ タグ編集
  • タグ:
  • R

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

目安箱バナー