diagtrplot {PKtools}R Documentation

diagtrplot

Description

diagtrplot creates a trellis plot of the observed concentrations and predicted values vs time by subject.

Usage

diagtrplot(x, level, xvarlab, yvarlab, pages,...)

Arguments

x variable identifying the clustering variable
level level of mixed model ("p"-population, "i"-individual)
xvarlab label for x variable
yvarlab label for y variable
pages number of pages to print, 1 prints first page
... additional arguments to be passed to lower level functions

Value

diagtrplot produces a trellis plot of observed concentrations and predicted values vs time by subject.

Author(s)

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

See Also

trplot, diagplot, residplot, obvsprplot, tex, HTMLtools

Examples

library(nlme) 
library(PKtools)
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)

diagtrplot(x=MM,level="p", xvarlab=nameData$xvarlab, 
yvarlab=nameData$xvarlab, pages=1)

[Package PKtools version 1.4-0 Index]