residplot {PKtools}R Documentation

residplot

Description

resid creates individual residual vs predicted plots at the population (marginal) and individual (conditinal) levels of the mixed model the can be used with the method identify to identify outliers.

Usage

residplot(x,...)

Arguments

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

Details

The method identify can be used with objects of class NONMEM, PKNLME, and WinBUGS by including the following code.

Value

plots of residual versus predicted values for both the population (marginal) and individual (conditional) levels.

Author(s)

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

See Also

identify, obvsprplot, diagplot

Examples

if (.Platform$OS.type =="windows"){
library(PKtools)
library(nlme) 
curwd=getwd()
if (file.exists("C:/nmv/run")){
  setwd("C:/nmv/run")
  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)
  residplot(NM, "p")
  setwd(curwd)
  }
  else{
      "You do not have NONMEM."
      }
}

[Package PKtools version 1.4-0 Index]