Skip to contents


This is largely now a legacy plotting function, replaced by plot.PM_sim. Plots PMsim objects with the option to perform a visual and numerical predictive check


# S3 method for PMsim
  mult = 1,
  log = TRUE,
  probs = c(0.05, 0.25, 0.5, 0.75, 0.95),
  binSize = 0,
  outeq = 1,
  pch = NA,
  join = TRUE,
  x.qlab = 0.4,
  cex.qlab = 0.8,
  pos.qlab = 1,
  ci = 0.95,
  cex.lab = 1.2,
  xlab = "Time (h)",
  ylab = "Output",
  ocol = "blue",
  add = FALSE,
  out = NA,



The name of an PMsim data object generated by SIMparse


Multiplication factor for y axis, e.g. to convert mg/L to ng/mL


Boolean operator to plot in log-log space; the default is False


Vector of quantiles to plot; if set to NA, all simulated profiles will be plotted, and numerical predictive checking will be suppressed


Width of binning interval for simulated concentrations, in time units, e.g. hours. For example, a binSize of 0.5 will pull all simulated concentrations +/- 0.5 hours into the same time. This is useful for plotting PMsim objects made during make_valid. The default is 0, i.e. no binning.


Which output equation to plot if more than 1


Controls the plotting symbol for observations; default is NA which results in no symbol. Use 0 for open square, 1 for open circle, 2 for open triangle, 3 for cross, 4 for X, or 5 for a diamond. Other alternatives are “*” for asterisks, “.” for tiny dots, or “+” for a smaller, bolder cross. These plotting symbols are standard for R (see par).


Boolean operator to join observations by a straight line; the default is True.


Proportionate value of x-axis at which to draw the quantile labels; 0 is left, 1 is right. The default is 0.4.


Size of the quantile labels.


This allows more refined positioning of the quantile labels. It takes standard R values: 1, below; 2, left; 3, above; 4, right.


Width of confidence interval bands around simulated quantiles, from 0 to 1. If 0, or nsim<100, will not plot. Default is 0.95, i.e. 95th percentile with tails of 2.5 percent above and below excluded.


Size of the plot labels.


Label for x-axis; default is “Time”


Label for y-axis; default is “Output”


Limits of the x-axis as a vector, e.g. c(0,1). It does not need to be specified, but can be.


Analogous to xlim


The name of an makeOP data object generated by makeOP. If specified, the observations will be overlaid upon the simulation plot enabling a visual predicitve check. In this case, a list object will be returned with two items: $npc containing the quantiles and probability that the observations are below each quantile (binomial test); and $simsum, the times of each observation and the value of the simulated quantile with upper and lower confidence intervals at that time.


Either a boolean operator to plot a reference grid, or a list with elements x and y, each of which is a vector specifying the native coordinates to plot grid lines; the default is False. For example, grid=list(x=seq(0,24,2),y=1:10). Defaults for missing x or y will be calculated by axTicks.


Color for observations


Boolean operator, if True will add lines to existing plot


Direct output to a PDF, EPS or image file. Format is a named list whose first argument, type is one of the following character vectors: “pdf”, “eps” (maps to postscript), “png”, “tiff”, “jpeg”, or “bmp”. Other named items in the list are the arguments to each graphic device. PDF and EPS are vector images acceptable to most journals in a very small file size, with scalable (i.e. infinite) resolution. The others are raster images which may be very large files at publication quality dots per inch (DPI), e.g. 800 or 1200. Default value is NA which means the output will go to the current graphic device (usually the monitor). For example, to output an eps file, out=list(“eps”) will generate a 7x7 inch (default) graphic.


Other parameters as found in plot.default.


Plots the simulation object. If obs is included, a list will be returned with the folowing items:


A dataframe with three columns: quantile, prop.less, pval. quantile are those specified by the prob argument to the plot call; prop.less are the proportion of simulated observations at all times less than the quantile; pval is the P-value of the difference in the prop.less and quantile by the beta-binomial test.


A dataframe with the quantile concentration at each simulated time, with lower and upper confidence intervals


A dataframe similar to an PMop object made by makeOP with the addition of the quantile for each observation


Simulated observations are plotted as quantiles on the y-axis vs. time on the x.axis. If measured observations are included, a visual and numerical predictive check will be performed.

See also


Michael Neely