Package 'morseDR'

Title: Bayesian Inference of Binary, Count and Continuous Data in Toxicology
Description: Advanced methods for a valuable quantitative environmental risk assessment using Bayesian inference of several type of toxicological data. 'binary' (e.g., survival, mobility), 'count' (e.g., reproduction) and 'continuous' (e.g., growth as length, weight). Estimation procedures can be used without a deep knowledge of their underlying probabilistic model or inference methods. Rather, they were designed to behave as well as possible without requiring a user to provide values for some obscure parameters. That said, models can also be used as a first step to tailor new models for more specific situations.
Authors: Virgile Baudrot [aut, cre], Sandrine Charles [aut], Marie Laure Delignette-Muller [aut], Nils Kehrein [ctb], Guillaume Kon-Kam-King [ctb], Christelle Lopes [ctb], Philippe Veber [aut]
Maintainer: Virgile Baudrot <[email protected]>
License: GPL (>= 3)
Version: 0.1.2
Built: 2026-05-11 07:42:18 UTC
Source: https://github.com/cran/morseDR

Help Index


Continuous response of toxicity test of cadmium on Daphnia

Description

  • cadmium_daphnia: Exposure of Daphnia magna to cadmium (5 concentrations including the control) during 21 days. 10 time-points and 4 replicates of 10 animals. Length data is collected (expressed in mm).

@references Billoir, E., Delignette-Muller, M.L., Pery, A.R.R. and Charles, S. (2008) A Bayesian Approach to Analyzing Ecotoxicological Data, Environmental Science & Technology, 42 (23), 8978-8984.

Usage

data(cadmium_daphnia)

Reproduction and survival data sets of chronic laboratory toxicity tests of cadmium with Daphnia

Description

  • cadmium1: Reproduction and survival data sets of chronic laboratory toxicity tests with Daphnia magna freshwater invertebrate exposed to five concentrations of cadmium during 21 days. Five concentrations were tested, with four replicates per concentration. Each replicate contained 10 organisms. Reproduction and survival were monitored at 10 time points.

Usage

data(cadmium1)

References

Billoir, E., Delhaye, H., Forfait, C., Clement, B., Triffault-Bouchet, G., Charles, S. and Delignette-Muller, M.L. (2012) Comparison of toxicity tests with different exposure time patterns: The added value of dynamic modelling in predictive ecotoxicology, Ecotoxicology and Environmental Safety, 75, 80-86.


Reproduction and survival data sets of chronic laboratory toxicity tests of cadmium with snails

Description

  • cadmium2: Reproduction and survival data sets of chronic laboratory toxicity tests with snails (Lymnaea stagnalis) exposed to six concentrations of cadmium during 28 days. Six concentrations were tested, with six replicates per concentration. Each replicate contained five organisms. Reproduction and survival were monitored at 17 time points.

Usage

data(cadmium2)

References

Ducrot, V., Askem, C., Azam, D., Brettschneider, D., Brown, R., Charles, S., Coke, M., Collinet, M., Delignette-Muller, M.L., Forfait-Dubuc, C., Holbech, H., Hutchinson, T., Jach, A., Kinnberg, K.L., Lacoste, C., Le Page, G., Matthiessen, P., Oehlmann, J., Rice, L., Roberts, E., Ruppert, K., Davis, J.E., Veauvy, C., Weltje, L., Wortham, R. and Lagadic, L. (2014) Development and validation of an OECD reproductive toxicity test guideline with the pond snail Lymnaea stagnalis (Mollusca, Gastropoda), Regulatory Toxicology and Pharmacology, 70(3), 605-14.

Charles, S., Ducrot, V., Azam, D., Benstead, R., Brettschneider, D., De Schamphelaere, K., Filipe Goncalves, S., Green, J.W., Holbech, H., Hutchinson, T.H., Faber, D., Laranjeiro, F., Matthiessen, P., Norrgren, L., Oehlmann, J., Reategui-Zirena, E., Seeland-Fremer, A., Teigeler, M., Thome, J.P., Tobor Kaplon, M., Weltje, L., Lagadic, L. (2016) Optimizing the design of a reproduction toxicity test with the pond snail Lymnaea stagnalis, Regulatory Toxicology and Pharmacology, vol. 81 pp.47-56.


Checking object structure for analysis

Description

Checks if an object can be used to perform data analysis.

  • binaryDataCheck: the function can be used to check if an object containing survival data is formatted according to the expectations of the BinaryData function.

  • continuousDataCheck: the function can be used to check if an object containing survival data is formatted according to the expectations of the continuousData function.

  • countDataCheck: the function can be used to check if an object containing data from a reproduction toxicity assay meets the expectations of the function countData. The countDataCheck performs the same checking than binaryDataCheck plus additional ones that are specific to reproduction data.

Usage

binaryDataCheck(data, quiet = FALSE)

continuousDataCheck(data, quiet = FALSE)

countDataCheck(data, quiet = FALSE)

Arguments

data

Any object, but usually a list or a data.frame.

quiet

Binary. Default is False. If True it returns messages of the checking function.

Value

The function returns a data.frame with message describing the error in the formatting of the data. When no error is detected the object is empty.

  • For countDataCheck, the function returns a data.frame similar to the one returned by binaryDataCheck, except that it may contain the following additional error ids:

    • NreproInteger: column Nrepro contains values of class other than integer

    • Nrepro0T0: Nrepro is not 0 at time 0 for each concentration and each replicate

    • Nsurvt0Nreprotp1P: at a given time TT, the number of alive individuals is null and the number of collected offspring is not null for the same replicate and the same concentration at time T+1T+1

See Also

binaryData

countData

continuousData

Examples

data(chlordan_daphnia)
continuousDataCheck(chlordan_daphnia)


# Run the check data function
data(copper)
countDataCheck(copper)

# Now we insert an error in the data set, by setting a non-zero number of
# offspring at some time, although there is no surviving individual in the
# replicate from the previous time point.
copper[148, "Nrepro"] <- as.integer(1)
countDataCheck(copper)

Reproduction and survival data sets of chronic laboratory toxicity tests of chlordan with Daphnia

Description

  • chlordan: Reproduction and survival data sets of chronic laboratory toxicity tests with Daphnia magna freshwater invertebrate exposed to six concentrations of one organochlorine insecticide (chlordan) during 21 days. Six concentrations were tested, with 10 replicates per concentration. Each replicate contained one organism. Reproduction and survival were monitored at 22 time points. See Manar et al. (2009).

Usage

data(chlordan)

References

Manar, R., Bessi, H. and Vasseur, P. (2009) Reproductive effects and bioaccumulation of chlordan in Daphnia magna, Environmental Toxicology and Chemistry, 28(10), 2150-2159.


Continuous response of toxicity test of chlordan on Daphnia

Description

  • chlordan_daphnia: Exposure of Daphnia magna to chlordan (6 concentrations including the control) at day 21. Length data is collected (expressed in mm). See Manar et al. (2009)

@references Manar, R., Bessi, H. and Vasseur, P. (2009) Reproductive effects and bioaccumulation of chlordan in Daphnia magna, Environmental Toxicology and Chemistry, 28(10), 2150-2159.

Usage

data(chlordan_daphnia)

Reproduction and survival data sets of chronic laboratory toxicity tests of copper on Daphnia

Description

  • copper: Reproduction and survival data sets of chronic laboratory toxicity tests with Daphnia magna freshwater invertebrate exposed to five concentrations of copper during 21 days. Five concentrations were tested, with three replicates per concentration. Each replicate contained 20 organisms. Reproduction and survival were monitored at 16 time points.

Usage

data(copper)

References

Billoir, E., Delignette-Muller, M.L., Pery, A.R.R. and Charles, S. (2008) A Bayesian Approach to Analyzing Ecotoxicological Data, Environmental Science & Technology, 42 (23), 8978-8984.


Continuous response of toxicity test of copper on Daphnia

Description

  • copper_daphnia: Exposure of Daphnia magna to copper (5 concentrations including the control) during 21 days. 16 time-points and 3 replicates of 20 animals. Length data is collected (expressed in mm).

Usage

data(copper_daphnia)

References

Billoir, E., Delignette-Muller, M.L., Pery, A.R.R. and Charles, S. (2008) A Bayesian Approach to Analyzing Ecotoxicological Data, Environmental Science & Technology, 42 (23), 8978-8984.


Survival data set of chronic laboratory toxicity tests of dichromate with Daphnia

Description

  • dichromate: Survival data set of chronic laboratory toxicity tests with Daphnia magna freshwater invertebrate exposed to six concentrations of one oxidizing agent (potassium dichromate) during 21 days. Six concentrations were tested with one replicate of 50 organisms per concentration. Survival is monitored at 10 time points.

Usage

data(dichromate)

References

Bedaux, J., Kooijman, SALM (1994) Statistical analysis of toxicity tests, based on hazard modeling, Environmental and Ecological Statistics, 1, 303-314.


Prepare data for Dose-Reponse

Description

Reshape data for using function on Dose-Reponse data#'

Usage

doseResponse(data, ...)

## S3 method for class 'BinaryData'
doseResponse(data, target.time = NULL, pool.replicate = FALSE, ...)

## S3 method for class 'CountData'
doseResponse(data, target.time = NULL, pool.replicate = FALSE, ...)

## S3 method for class 'ContinuousData'
doseResponse(data, target.time = NULL, pool.replicate = FALSE, ...)

Arguments

data

an object used to select a method doseResponse

...

Further arguments to be passed to generic methods

target.time

Numeric. Default is NULL. By default, the last time is considerd as the target-time. Otherwise, the argument set the target time.

pool.replicate

Binary. Default is FALSE. IF TRUE, data are summed according to groupd of the same time and conc.

Value

an object of class DoseResponse


Extract simulation from the fit

Description

Extract simulation from the fit

Usage

extract_sim(fit)

Arguments

fit

object of class FitTT

Value

return a list with 2 data.frame:

  • mcmc: a data.frame with simulated data.

  • quantile: a data.frame with quantile of the simulated data.


Fits a Bayesian concentration-response model for target-time

Description

  • binary data: This function estimates the parameters of a concentration-response model for target-time binary data analysis using Bayesian inference. In this model, the rate of binary effect (survival or immobility) individuals at a given time point (called target time) is modeled as a function of the chemical compound concentration. The actual number of surviving individuals is then modeled as a stochastic function of the survival rate. Details of the model are presented in the vignette accompanying the package.

  • count data: This function estimates the parameters of a concentration-effect model for target-time reproduction analysis using Bayesian inference. In this model the endpoint is the cumulated number of event (like reproduction) over time, with potential failure (death) all along the experiment. Particularly dedicated to reproduction data, because some individuals may die during the observation period, the reproduction rate alone is not sufficient to account for the observed number of offspring at a given time point. In addition, we need the time individuals have stayed alive during this observation period. The fit function estimates the number of individual-days in an experiment between its start and the target time. This covariable is then used to estimate a relation between the chemical compound concentration and the reproduction rate per individual-day. The fit function on CountData fits two models, one where inter-individual variability is neglected ("Poisson" model) and one where it is taken into account ("gamma-Poisson" model). When setting stoc.part to "bestfit", a model comparison procedure is used to choose between both. More details are presented in the vignette accompanying the package.

  • continuous data: This function estimates the parameters of a concentration-response model for target-time of any continuous data analysis using Bayesian inference. This model is particularly well-suited for growth data. Details of the model are presented in the vignette accompanying the package. We can choose the stochastic part to be either "gamma" or "normal", with a default to "gamma".

Usage

## S3 method for class 'BinaryData'
fit(
  data,
  target.time = NULL,
  inits = NULL,
  n.chains = 3,
  n.adapt = 3000,
  quiet = FALSE,
  warning.print = TRUE,
  n.iter = NA,
  ...
)

## S3 method for class 'ContinuousData'
fit(
  data,
  stoc.part = "gamma",
  target.time = NULL,
  inits = NULL,
  n.chains = 3,
  n.adapt = 3000,
  quiet = FALSE,
  warning.print = TRUE,
  n.iter = NA,
  low.asympt = FALSE,
  ...
)

## S3 method for class 'CountData'
fit(
  data,
  stoc.part = "bestfit",
  target.time = NULL,
  inits = NULL,
  n.chains = 3,
  n.adapt = 3000,
  quiet = FALSE,
  warning.print = TRUE,
  n.iter = NA,
  ...
)

fit(data, ...)

Arguments

data

an object of class BinaryData, CountData or CountinuousData

target.time

the chosen endpoint to evaluate the effect of the chemical compound concentration, by default the last time point available for all concentrations

inits

See jags.model. Optional specification of initial values.

n.chains

number of MCMC chains, the minimum required number of chains is 2

n.adapt

The number of iterations for adaptation. See jags.model for further details.

quiet

if TRUE, does not print messages and progress bars from JAGS

warning.print

if TRUE, print the warnings in REPL

n.iter

if NA, default, the number of iteration is estimated from raftery.diag process, otherwise, set the n.iter provided.

...

Further arguments to be passed to generic methods

stoc.part

a string for stochastic part. For "" model, the stoc.part is "gamma" (default) but can be "normal".

low.asympt

binary TRUE/FALSE. If TRUE, a parameter for the lower side of the assymptote is compute in case of Continuous Data. Default is FALSE.

Value

The function returns an object of class FitTT and BinaryFitTT, which is a list with the following information:

mcmc

an object of class mcmc.list with the posterior distribution

warnings

a table with warning messages

parameters

a list of parameter names used in the model

model.specification

a set of parameters describing th model used

jags.data

a list of the data passed to the JAGS model

original.data

the survData object passed to the function

dataTT

the dataset with which the parameters are estimated


Creates a data set for binary data analysis

Description

The data argument contains the experimental data provided as a data.frame. It as to satisfied requirement of BinaryData, CounData or ContinuousData as detailled below. The function fails if data does not meet the expected requirements. Note that experimental data with time-variable exposure are not supported.

  • binaryData This function creates a BinaryData object from experimental data. The resulting object can then be used for plotting and model fitting. It can also be used to generate individual-time estimates. The BinaryData argument describes experimental results from a survival (or mobility) toxicity test. Each line of the data.frame corresponds to one experimental measurement, that is for instance a number of alive individuals at a given concentration at a given time point and in a given replicate. Note that either the concentration or the number of alive individuals may be missing. The data set is inferred to be under constant exposure if the concentration is constant for each replicate and systematically available. Please run binaryDataCheck to ensure data is well-formed.

  • countData: This function creates a CountData object from experimental data provided as a data.frame. The resulting object can then be used for plotting and model fitting. The CountData class is a sub-class of BinaryData, meaning that all functions and method available for binary data analysis can be used with CountData objects. Please run countDataCheck to ensure data is well-formed.

  • continuousData: This function creates a ContinuousData object from experimental data provided as a data.frame. The resulting object can then be used for plotting and model fitting. Each line of the data.frame. The function continuousData fails if data does not meet the expected requirements. Please run continuousDataCheck to ensure data is well-formed.

Usage

binaryData(data, ...)

## S3 method for class 'data.frame'
binaryData(data, ...)

continuousData(data, ...)

## S3 method for class 'data.frame'
continuousData(data, ...)

countData(data, ...)

## S3 method for class 'data.frame'
countData(data, ...)

modelData(data, type, ...)

## S3 method for class 'data.frame'
modelData(data, type = NULL, ...)

Arguments

data

a data.frame with specific requirement.

  • For BinaryData: it should be a data.frame containing the following four columns:

    • replicate: a vector of any class numeric, character or factor for replicate identification. A given replicate value should identify the same group of individuals followed in time

    • conc: a vector of class numeric with tested concentrations (positive values, may contain NAs)

    • time: a vector of class integer with time points, minimal value must be 0

    • Nsurv: a vector of class integer providing the number of alive individuals at each time point for each concentration and each replicate (may contain NAs)

  • For CountData: it's a data.frame as expected by BinaryData containing one additional Nrepro column of class integer with positive values only. This column should provide the number of offspring produced since the last observation.

  • For continuousData: a data.frame containing the following four columns:

    • conc: a vector of class numeric with tested concentrations (positive values, may contain NAs)

    • time: a vector of class integer with time points, minimal value must be 0

    • measure: a vector of class numeric providing the measurement (any quantitative continuous variable describing a measure on the organisms such as length/weight of organism or shoot length and dry weight for plants.)

    • replicate (non mandatory): a vector of any class numeric, character or factor for replicate identification. A given replicate value should identify the same group of individuals followed in time

...

Further arguments to be passed to generic methods

type

must be declared as 'binary', 'count' or 'continuous'.

Value

An object of class BinaryData, CountData or ContinuousData.

See Also

binaryDataCheck

countDataCheck

continuousDataCheck

Examples

# (1) Load the survival data set
data(zinc)
# (2) Create an objet of class 'BinaryData'
dat <- binaryData(zinc)
class(dat)


# (1) Load the data set
data(chlordan_daphnia)
# (2) Create an objet of class 'continuousData'
dat <- continuousData(chlordan_daphnia)
class(dat)


# (1) Load reproduction dataset
data(cadmium1)
# (2) Create an object of class "CountData"
dat <- countData(cadmium1)
class(dat)


# Create an objet of class 'CountData'
d <- modelData(zinc, type = "count")
class(d)

Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant01)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant02)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant03)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant04)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant05)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant06)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant07)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant08)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant09)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Continuous response of toxicity test on plants

Description

  • plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected

Usage

data(plant10)

References

Charles, S., Wu, D., Ducrot, V. (2021). How to account for the uncertainty from standard toxicity tests in species sensitivity distributions: An example in non-target plants. PLOS ONE


Plotting method for BinaryData, CountData or ContinuousData.

Description

This is the generic plot S3 method for the BinaryData, CountData and ContinuousData classes.

  • BinaryData: It plots the sum of non-failure (survivor, mobile) individuals as a function of time.

  • CountData: It plots the cumulated number of offspring as a function of time.

  • Continuous: It plots the continuous data as a function of time by concentration panels.

Usage

## S3 method for class 'BinaryData'
plot(
  x,
  xlab = "Time",
  ylab = "Sum of Non-Failure",
  main = NULL,
  concentration = NULL,
  pool.replicate = FALSE,
  addlegend = FALSE,
  ...
)

## S3 method for class 'ContinuousData'
plot(
  x,
  xlab = "Time",
  ylab = "Measure",
  main = NULL,
  concentration = NULL,
  addlegend = FALSE,
  ...
)

## S3 method for class 'CountData'
plot(
  x,
  xlab = "Time",
  ylab = "Cumulated Response",
  main = NULL,
  concentration = NULL,
  pool.replicate = FALSE,
  addlegend = FALSE,
  ...
)

Arguments

x

an object of class BinaryData, CountData or ContinuousData

xlab

a label for the XX-axis, by default Time

ylab

a label for the YY-axis, by default Sum of Non-Failure for BinaryData, Cumulated Response for CountData, and Measure for ContinuousData.

main

title for the plot

concentration

a numeric value corresponding to some concentration(s) in data. If concentration = NULL, draws a plot for each concentration

pool.replicate

if TRUE, the datapoints of each replicate are summed for a same concentration

addlegend

if TRUE, adds a default legend to the plot

...

Further arguments to be passed to generic methods

Value

a plot of class ggplot


Plot dose-response from DoseResponse objects

Description

This is the generic plot S3 method for the DoseResponse class. It plots the survival probability as a function of concentration at a given target time.

  • For BinaryData object: The function plots the observed values of the survival probability at a given time point as a function of concentration. The 95% binomial confidence interval is added to each survival probability. It is calculated using function binom.test from package stats. Replicates are systematically pooled in this plot.

  • For CountData object: The function plots the observed values of the Number of at a given time point as a function of concentration. The 95% binomial confidence interval is added to each survival probability. It is calculated using function poisson.test. Replicates are systematically pooled in this plot.

  • For ContinuousData object: the function plots observed values of the response at a given time point as a function of concentration. The 95% binomial confidence interval is added to each set of data at each concentration. It is calculated using function t.test from package stats.

Usage

## S3 method for class 'DoseResponse'
plot(
  x,
  xlab = "Dose",
  ylab = NULL,
  main = NULL,
  log.scale = FALSE,
  addlegend = TRUE,
  dodge.width = 0,
  ...
)

## S3 method for class 'BinaryDoseResponse'
plot(
  x,
  xlab = "Concentration",
  ylab = NULL,
  main = NULL,
  log.scale = FALSE,
  addlegend = TRUE,
  dodge.width = 0,
  ...
)

## S3 method for class 'CountDoseResponse'
plot(
  x,
  xlab = "Concentration",
  ylab = NULL,
  main = NULL,
  log.scale = FALSE,
  addlegend = TRUE,
  dodge.width = 0,
  ...
)

## S3 method for class 'ContinuousDoseResponse'
plot(
  x,
  xlab = "Concentration",
  ylab = NULL,
  main = NULL,
  log.scale = FALSE,
  addlegend = TRUE,
  dodge.width = 0,
  ...
)

Arguments

x

an object of class BinaryData, CountData or ContinuousData

xlab

a label for the XX-axis, by default Dose

ylab

a label for the YY-axis, by default Response

main

main title for the plot

log.scale

if TRUE, displays XX-axis in log-scale

addlegend

if TRUE, adds a default legend to the plot

dodge.width

dodging width. Dodging preserves the vertical position of an geom while adjusting the horizontal position.

...

Further arguments to be passed to generic methods

Value

a plot of class ggplot


Plotting method for FitTT objects.

Description

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

The fitted curve represents the response at the target time as a function of the concentration of chemical compound; When adddata = TRUE the black dots depict the observation data 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\ (by default the grey area around the fitted curve) and 95\ intervals (as black segments if adddata = TRUE), either binomial, poisson or normal for respectivelly, BinaryFitTT, CountFitTT andContinuousFitTT. 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\ taken for this sample).

Usage

## S3 method for class 'BinaryFitTT'
plot(
  x,
  xlab = "Concentration",
  ylab = "Probability",
  main = NULL,
  display.conc = NULL,
  spaghetti = FALSE,
  adddata = FALSE,
  addlegend = FALSE,
  log.scale = FALSE,
  ...
)

## S3 method for class 'ContinuousFitTT'
plot(
  x,
  xlab = "Concentration",
  ylab = "Measure",
  main = NULL,
  display.conc = NULL,
  spaghetti = FALSE,
  adddata = FALSE,
  addlegend = FALSE,
  log.scale = FALSE,
  ...
)

## S3 method for class 'CountFitTT'
plot(
  x,
  xlab = "Concentration",
  ylab = "Count",
  main = NULL,
  display.conc = NULL,
  spaghetti = FALSE,
  adddata = FALSE,
  addlegend = FALSE,
  log.scale = FALSE,
  ...
)

Arguments

x

an object of class FitTT

xlab

a label for the XX-axis, default is Concentration

ylab

a label for the YY-axis. For BinaryFitTT default is Probability; For CountFitTT, default is Count, and For ContinuousFitTT, default is Measure.

main

main title for the plot

display.conc

Vector of numeric on which the plot is done. Default is NULL to use the concentration given in the FitTT object.

spaghetti

if TRUE, the credible interval is represented by multiple curves

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 XX-axis in log-scale

...

Further arguments to be passed to generic methods

Value

a plot of class ggplot


Plot the Posterior Predictive Chack on an object PPC

Description

This is the generic plot S3 method for the PPC class. It plots the predicted values with 95 \ values for FitTT objects.

The coordinates of black points are the observed values of the number of survivors (pooled replicates) for a given concentration (XX-axis) and the corresponding predicted values (YY-axis). 95\ value, colored in green if this interval contains the observed value and in red otherwise. The bisecting line (y = x) is added to the plot in order to see if each prediction interval contains each observed value. As replicates are shifted on the x-axis, this line is represented by steps.

Usage

## S3 method for class 'PPC'
plot(
  x,
  xlab = "Observation",
  ylab = "Prediction",
  main = NULL,
  dodge.width = 0,
  ...
)

Arguments

x

an object of class PPC

xlab

label of the x-axis

ylab

label of the y-axis

main

title of the graphic

dodge.width

dodging width. Dodging preserves the vertical position of an geom while adjusting the horizontal position. See position_dodge for further details.

...

Further arguments to be passed to generic methods

Value

a plot of class ggplot


Plot an object XCX

Description

Plot the median and 95\ Concentration.

Usage

## S3 method for class 'XCX'
plot(x, xlab = NULL, ylab = NULL, main = NULL, ...)

Arguments

x

an object of class XCX

xlab

label of the x-axis

ylab

label of the y-axis

main

title of the graphic

...

Further arguments to be passed to generic methods

Value

a plot of class ggplot


Posterior Predictive Check data.frame for FitTT objects

Description

Create the PPC object to be pass in plot function for plotting the Posterior Predictive Check.#'

Usage

ppc(fit, ...)

## S3 method for class 'ContinuousFitTT'
ppc(fit, ...)

## S3 method for class 'CountFitTT'
ppc(fit, ...)

## S3 method for class 'BinaryFitTT'
ppc(fit, ...)

Arguments

fit

An object of class FitTT

...

Further arguments to be passed to generic methods

Value

An object of class 'PPC'


Prediction base on FitTT

Description

Prediction base on FitTT

Usage

predict(fit, ...)

## S3 method for class 'BinaryFitTT'
predict(fit, display.conc = NULL, ...)

## S3 method for class 'ContinuousFitTT'
predict(fit, display.conc = NULL, ...)

## S3 method for class 'CountFitTT'
predict(fit, display.conc = NULL, ...)

Arguments

fit

object of class BinaryFitTT, CountFitTT or ConitnuousFitTT.

...

Further arguments to be passed to generic methods

display.conc

vector of concentrations values (x axis)

Value

A list of 3 elements: 'display.conc' a vector of the display concentration of exposure, 'mcmc': a data.frame of the mcmc and 'quantile' a data.frame of quantiles.


Return Prior and Posterior density of parameters of FitTT object

Description

Return Prior and Posterior density of parameters of FitTT object

Extract posterior of parameters from a FitTT object#'

Usage

## S3 method for class 'PriorPosterior'
plot(x, xlab = "value", ylab = NULL, main = NULL, ...)

priorPosterior(fit, size_sample, ...)

## S3 method for class 'BinaryFitTT'
priorPosterior(fit, size_sample = 1000, ...)

## S3 method for class 'CountFitTT'
priorPosterior(fit, size_sample = 1000, ...)

## S3 method for class 'ContinuousFitTT'
priorPosterior(fit, size_sample = 1000, ...)

posterior(fit, ...)

## S3 method for class 'FitTT'
posterior(fit, ...)

Arguments

x

an object of class PriorPosterior

xlab

label of the x-axis

ylab

label of the y-axis

main

title of the graphic

...

Further arguments to be passed to generic methods

fit

An object of class FitTT

size_sample

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

Value

a data frame of class PriorPosterior

Return an object of class Posterior


Survival data set of chronic laboratory toxicity tests of propiconazole with Gammarus pulex

Description

  • propiconazole: Survival data set of chronic laboratory toxicity tests with Gammarus pulex freshwater invertebrate exposed to eight concentrations of one fungicide (propiconazole) during four days. Eight concentrations were tested with two replicates of 10 organisms per concentration. Survival is monitored at five time points.

Usage

data(propiconazole)

References

Nyman, A.-M., Schirmer, K., Ashauer, R., (2012) Toxicokinetic-toxicodynamic modelling of survival of Gammarus pulex in multiple pulse exposures to propiconazole: model assumptions, calibration data requirements and predictive power, Ecotoxicology, (21), 1828-1840.


Continuous response of toxicity test

Description

Additional dataset for continuous data

Usage

data(reco27)

Predict X% Concentration at the target time (default).

Description

Predict median and 95\ Concentration.

Usage

xcx(fit, x, ...)

## S3 method for class 'FitTT'
xcx(fit, x, ...)

Arguments

fit

An object used to select a method

x

vector of values of LCx or ECX

...

Further arguments to be passed to generic methods

Value

returns an object of class XCX consisting in a data.frame with the estimated ECx or LCx and their CIs 95% (3 columns (values, CIinf, CIsup) and length(x) rows)


Continuous response of toxicity test on snails

Description

  • subst01_lymnaea: Exposure of snails to a given substance (6 concentrations including the control) at day 56. Length of shell is collected (expressed in mm).

@references Ducrot, V., Askem, C., Azam, D., Brettschneider, D., Brown, R., Charles, S., Coke, M., Collinet, M., Delignette-Muller, M.L., Forfait-Dubuc, C., Holbech, H., Hutchinson, T., Jach, A., Kinnberg, K.L., Lacoste, C., Le Page, G., Matthiessen, P., Oehlmann, J., Rice, L., Roberts, E., Ruppert, K., Davis, J.E., Veauvy, C., Weltje, L., Wortham, R. and Lagadic, L. (2014) Development and validation of an OECD reproductive toxicity test guideline with the pond snail Lymnaea stagnalis (Mollusca, Gastropoda), Regulatory Toxicology and Pharmacology, 70(3), 605-14.

Usage

data(subst01_lymnaea)

Summary of FitTT object

Description

This is the generic summary S3 method for the FitTT class. It shows the quantiles of priors and posteriors on parameters and the quantiles of the posteriors on the ECx and LCx estimates.

Summary function on PPC object

Usage

## S3 method for class 'BinaryFitTT'
summary(object, quiet = FALSE, ...)

## S3 method for class 'ContinuousFitTT'
summary(object, quiet = FALSE, ...)

## S3 method for class 'CountFitTT'
summary(object, quiet = FALSE, ...)

## S3 method for class 'PPC'
summary(object, quiet = FALSE, ...)

Arguments

object

an object of class FitTT

quiet

when TRUE, does not print

...

Further arguments to be passed to generic methods

Value

The function returns a list with the following information:

Qpriors

quantiles of the model priors

Qposteriors

quantiles of the model posteriors

QLCx

quantiles of LCx estimates


Reproduction and survival data sets of a chronic laboratory toxicity tests of zinc with Daphnia

Description

  • zinc: Reproduction and survival data sets of a chronic laboratory toxicity tests with Daphnia magna freshwater invertebrate exposed to four concentrations of zinc during 21 days. Four concentrations were tested with three replicates per concentration. Each replicate contained 20 organisms. Reproduction and survival were monitored at 15 time points.

Usage

data(zinc)

References

Billoir, E., Delignette-Muller, M.L., Pery, A.R.R. and Charles, S. (2008) A Bayesian Approach to Analyzing Ecotoxicological Data, Environmental Science & Technology, 42 (23), 8978-8984.


Continuous response of toxicity test of zinc on Daphnia

Description

  • zinc_daphnia: Exposure of Daphnia magna to zinc (4 concentrations including the control) during 21 days. 15 time-points and 3 replicates of 20 animals. Length data is collected (expressed in mm).

Usage

data(zinc_daphnia)

References

Billoir, E., Delignette-Muller, M.L., Pery, A.R.R. and Charles, S. (2008) A Bayesian Approach to Analyzing Ecotoxicological Data, Environmental Science & Technology, 42 (23), 8978-8984.