plot-methods: Methods for Function 'plot' in Package 'QMRA'

Description Usage Arguments Methods Examples

Description

Plot dose-response curves from objects of class "drm" and "bdrm".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'drm,ANY'
plot(x, y, se = TRUE, add = FALSE, n = NULL, min_log10dose = 0,
     xlab = "log10(dose)", ylab = "P(infection)",
     type = "l", lwd = 2, col = "red",
     se_pars = list(type = "l", lty = 2, lwd = 2, col = "blue"),
     sim_pars = list(type = "l", lty = 1, col = rgb(0, 0, 0, 0.1)),
     ...)

## S4 method for signature 'bdrm,ANY'
plot(x, y, n = 100, add = FALSE, ...)

Arguments

x

Object of class "drm" or "bdrm".

y

Ignored.

se

Logical. Should a 95% confidence interval be plotted? Defaults to TRUE.

add

Logical. If TRUE, plots are added to current one, using lines.

n

Number of simulated dose-response curves to be plotted (generated using sim. Defaults to NULL.

min_log10dose

Lower bound of x axis; defaults to 0.

xlab,ylab

Titles for x and y axes.

type,lwd,col

Type, line width and color of dose-response curve.

se_pars

List of graphical parameters for the 95% confidence interval curves; see par.

sim_pars

List of graphical parameters for the simulated dose-response curves; see par.

...

Other arguments to be passed to plot.

Methods

signature(x = "ANY", y = "ANY")
signature(x = "bdrm", y = "ANY")
signature(x = "drm", y = "ANY")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Fit Beta-Poisson model to Campylobacter dataset
drm_fit <- drm(x = infected, n = total, dose = dose,
               data = campy, model = "bp")
## Plot fitted dose-response curve and 100 simulated curves
plot(drm_fit, se = TRUE, sim = 100)
           
## Fit Bayesian Beta-Poisson model to Campylobacter dataset
bdrm_fit <- bdrm(x = infected, n = total, dose = dose,
                 data = campy, model = "bp",
                 inits = list(alpha = 1, beta = 1))
## Plot 100 simulated dose-response curves
plot(bdrm_fit, sim = 100)

brechtdv/QMRA documentation built on May 13, 2019, 5:06 a.m.