diagplot {PKtools}R Documentation

diagplot

Description

diagplot creates plots of observed versus predicted values and residuals (ordinary and standardized) versus predicted values for both the population (marginal) and individual (conditional) levels.

Usage

diagplot(x,...)

Arguments

x object of class, NONMEM, PKNLME, WinBUGS
... additional arguments to be passed to lower level functions

Value

Plots of observed versus predicted values and residuals (ordinary and standardized) versus predicted values for both the population (marginal) and individual (conditional) levels.

Author(s)

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

See Also

residplot, obvsprplot, identify

Examples

if (.Platform$OS.type =="windows"){
curwd=getwd()
if (file.exists("C:/nmv/run")) {
  setwd("C:/nmv/run")
  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

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

  data<-list(pkvar=Theo, cov=wt.v)
  NM<-RunNM(inputStructure="control.model5", data=data, nameData=nameData)
  diagplot(NM)
  setwd(curwd)
  }
  else{
    "You do not have NONMEM."
    } 
}

[Package PKtools version 1.4-0 Index]