plot.survFitTT: Plotting method for 'survFitTT' objects

View source: R/plot.survFitTT.R

plot.survFitTTR Documentation

Plotting method for survFitTT objects

Description

This is the generic plot S3 method for the survFitTT class. It plots concentration-response fit under target time survival analysis.

Usage

## S3 method for class 'survFitTT'
plot(
  x,
  xlab = "Concentration",
  ylab = "Survival probability",
  main = NULL,
  fitcol = "orange",
  fitlty = 1,
  fitlwd = 1,
  spaghetti = FALSE,
  cicol = "orange",
  cilty = 2,
  cilwd = 1,
  ribcol = "grey70",
  adddata = FALSE,
  addlegend = FALSE,
  log.scale = FALSE,
  style = "ggplot",
  ...
)

Arguments

x

an object of class survFitTT

xlab

a label for the X-axis, default is Concentration

ylab

a label for the Y-axis, default is Survival probability

main

main title for the plot

fitcol

color of the fitted curve

fitlty

line type of the fitted curve

fitlwd

width of the fitted curve

spaghetti

if TRUE, the credible interval is represented by multiple curves

cicol

color of the 95 % credible interval limits

cilty

line type for the 95 % credible interval limits

cilwd

width of the 95 % credible interval limits

ribcol

color of the ribbon between lower and upper credible limits. Transparent if NULL

adddata

if TRUE, adds the observed data with confidence intervals to the plot

addlegend

if TRUE, adds a default legend to the plot

log.scale

if TRUE, displays X-axis in log-scale

style

graphical backend, can be 'generic' or 'ggplot'

...

Further arguments to be passed to generic methods

Details

The fitted curve represents the estimated survival probability at the target time as a function of the concentration of chemical compound; When adddata = TRUE the black dots depict the observed survival probability at each tested concentration. Note that since our model does not take inter-replicate variability into consideration, replicates are systematically pooled in this plot. The function plots both 95% credible intervals for the estimated survival probability (by default the grey area around the fitted curve) and 95% binomial confidence intervals for the observed survival probability (as black segments if adddata = TRUE). Both types of intervals are taken at the same level. Typically a good fit is expected to display a large overlap between the two intervals. If spaghetti = TRUE, the credible intervals are represented by two dotted lines limiting the credible band, and a spaghetti plot is added to this band. This spaghetti plot consists of the representation of simulated curves using parameter values sampled in the posterior distribution (10% of the MCMC chains are randomly taken for this sample).

Value

a plot of class ggplot

Note

When style = "ggplot", the function calls function ggplot and returns an object of class ggplot.

Examples


# (1) Load the data
data(cadmium1)

# (2) Create an object of class "survData"
dat <- survData(cadmium1)


# (3) Run the survFitTT function with the log-logistic
#     binomial model
out <- survFitTT(dat, lcx = c(5, 10, 15, 20, 30, 50, 80),
                 quiet = TRUE)

# (4) Plot the fitted curve
plot(out, log.scale = TRUE, adddata = TRUE)

# (5) Plot the fitted curve with ggplot style
plot(out, xlab = expression("Concentration in" ~ mu~g.L^{-1}),
     fitcol = "blue", adddata = TRUE, cicol = "blue",
     style = "ggplot")



morse documentation built on Oct. 29, 2022, 1:14 a.m.