trplot {PKtools}R Documentation

trplot

Description

trplot creates a trellis plot of concentration vs time by subject.

Usage

trplot(x, xvarlab, yvarlab, pages,...)

Arguments

x object of class, NONMEM, PKNLME, WinBUGS
xvarlab label for x variable
yvarlab label for y variable
pages number of pages you want to print, pages=1 prints the first page
... additional arguments to be passed to lower level functions

Value

A trellis plot of concentration vs time by subject.

Author(s)

M.S. Blanchard <sblanchard@coh.org>

See Also

diagtrplot

Examples

#NLME example
library(PKtools)
library(nlme) 
data(Theoph) 
Theoph<-Theoph[Theoph$Time!=0,]
id<-as.numeric(as.character(Theoph$Subject)) 
dose<-Theoph$Dose
time<-Theoph$Time 
conc<-round(sqrt(Theoph$conc),4)
Theo<-data.frame(cbind(id,dose,time,conc))
names(Theo)<-c("id","dose","time","conc") 
wt.v<-Theoph$Wt

data<-list(pkvar=Theo, cov=wt.v) 

nameData<-list(covnames=c("wt"),
               yvarlab="Sqrt(Theop. Conc.) (mg/L)",
               xvarlab="Time since dose (hrs)",
               reparams=c("Cl"),
               params=c("Ka","V", "Cl"),
               tparams=c("log(Ka)","log(V)","log(CL)"))

model.def<-list(fixed.model=lKa+lV+lCl~1,random.model=lCl~1,
start.lst=c(lKa=.3,lV=-.6,lCl=-3), form=conc~sonecpmt(dose, time,
lV, lKa, lCl), control=nlmeControl(returnObject=FALSE))

MM<-RunNLME(inputStructure=model.def, data=data, nameData=nameData)
trplot(x=MM,yvarlab=nameData$yvarlab,xvarlab=nameData$xvarlab,pages=1)

[Package PKtools version 1.4-0 Index]