nlme.vpcplot: Plot a VPC of an nlme object

View source: R/nlme.vpcplot.r

nlme.vpcplotR Documentation

Plot a VPC of an nlme object

Description

Plot a VPC of an nlme object

Usage

## S3 method for class 'vpcplot'
nlme(
  object,
  vpc,
  formula,
  obsData = NULL,
  xLabel,
  yLabel,
  xLimits,
  yLimits,
  logY = FALSE,
  color.style = list(observed = rgb(0.2, 0.2, 0.2), central = blue[10], inner = blue[4],
    outer = blue[1]),
  symbol = list(pch = 15, cex = 0.5),
  aspect = 1,
  cex.label = 1.5,
  nx = NULL,
  showPredAs = "area",
  showObsDots = TRUE,
  showObsLines = TRUE,
  obscol.dot = gray[8],
  obscex.dot = 0.5,
  obspch.dot = 1,
  obscol.line = gray[10],
  predcol.central = blue[6],
  predcol.outer = blue[7],
  predcol.area = blue[1],
  predcol.inner = blue[3],
  ...
)

Arguments

object

the nlme object (if it's an nlme.run object the input should read object$object)

vpc

the output from nlme.vpc

formula

a formula detailing what to plot

obsData

the observation data, if not supplied defaults to obsData = getData(object). Use if newdata in extract.nlme was specified

xLabel

same as xlab

yLabel

same as ylab

xLimits

same as xlim

yLimits

same as ylim

logY

logical to log Y axis

color.style

list with layout options, such as:

symbol

list with elements pch (15) and cex (0.5)

aspect

trellis banking value (defaults to 1 for sqaure panels)

cex.label

tex size for x and y labels (1.5)

nx

number of bins for x covariate

showPredAs

layout style (defaults to "area" for polygons but could be 'lines' too).

showObsDots

logical to showobserved dots (T)

showObsLines

logical to show quantile lines of observed (T)

obscol.dot

color of observed dot

obscex.dot

symbol size

obspch.dot

type of symbol

obscol.line

observed line color

predcol.central

predicted central tendency color

predcol.outer

predicted outer polygon color

predcol.area

predicted overall polygon color

predcol.inner

predicted inner polygon (IQR) color

...

any additional arguments passed on to the lattice call

Value

A VPC plot.

See Also

nlme.vpc, nlme.extract

Examples

# library(nlme)
pkpdData = example.pkpdData()
EFF.1comp.1abs <- function(dose, tob, cl, v, ka, keo)
 {
   # Effect-site concentration for 1-compartment model, 1st-order absorption

   kel = cl / v

   # Define coefficients
   A = 1/(kel-ka) / (keo-ka)
   B = 1/(ka-kel) / (keo-kel)
   C = 1/(ka-keo) / (kel-keo)

   # Return effect-site concentration
   dose*ka*keo/v * (A*exp(-ka*tob) + B*exp(-kel*tob) + C*exp(-keo*tob))
 }
 fit.PD004.nlme = nlme.run(
   model = value ~ base + EFF.1comp.1abs(dose, time, cl * exp(cl.eta), v, ka, keo),
   data = pkpdData[pkpdData$type == "PD" & pkpdData$dose > 0 & pkpdData$value > 0.5, ],
   fixed = base + cl + v + ka + keo ~ 1,
   random = cl.eta ~ 1,
   groups = ~ id,
   start = c(base = 1, cl = 1, v = 10, ka = 1, keo = 0.01),
   problem = "True Model",
   reference = 4)
 summary(fit.PD004.nlme$object)
 nlme.extract(fit.PD004.nlme$object)$table
 vpc.PD004.nlme = nlme.vpc(fit.PD004.nlme$object, nrep = 100)
 nlme.vpcplot(fit.PD004.nlme$object, vpc.PD004.nlme)

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.