| 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 |
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.
data(cadmium_daphnia)data(cadmium_daphnia)
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.
data(cadmium1)data(cadmium1)
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.
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.
data(cadmium2)data(cadmium2)
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.
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.
binaryDataCheck(data, quiet = FALSE) continuousDataCheck(data, quiet = FALSE) countDataCheck(data, quiet = FALSE)binaryDataCheck(data, quiet = FALSE) continuousDataCheck(data, quiet = FALSE) countDataCheck(data, quiet = FALSE)
data |
Any object, but usually a |
quiet |
Binary. Default is |
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 , 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
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)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)
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).
data(chlordan)data(chlordan)
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.
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.
data(chlordan_daphnia)data(chlordan_daphnia)
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.
data(copper)data(copper)
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.
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).
data(copper_daphnia)data(copper_daphnia)
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.
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.
data(dichromate)data(dichromate)
Bedaux, J., Kooijman, SALM (1994) Statistical analysis of toxicity tests, based on hazard modeling, Environmental and Ecological Statistics, 1, 303-314.
Reshape data for using function on Dose-Reponse data#'
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, ...)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, ...)
data |
an object used to select a method |
... |
Further arguments to be passed to generic methods |
target.time |
Numeric. Default is |
pool.replicate |
Binary. Default is |
an object of class DoseResponse
Extract simulation from the fit
extract_sim(fit)extract_sim(fit)
fit |
object of class |
return a list with 2 data.frame:
mcmc: a data.frame with simulated data.
quantile: a data.frame with quantile of the simulated data.
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".
## 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, ...)## 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, ...)
data |
an object of class |
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 |
warning.print |
if |
n.iter |
if |
... |
Further arguments to be passed to generic methods |
stoc.part |
a string for stochastic part. For "" model, the
|
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. |
The function returns an object of class FitTT and
BinaryFitTT, which is a list with the following information:
an object of class mcmc.list with the posterior
distribution
a table with warning messages
a list of parameter names used in the model
a set of parameters describing th model used
a list of the data passed to the JAGS model
the survData object passed to the function
the dataset with which the parameters are estimated
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.
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, ...)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, ...)
data |
a
|
... |
Further arguments to be passed to generic methods |
type |
must be declared as 'binary', 'count' or 'continuous'. |
An object of class BinaryData, CountData or
ContinuousData.
# (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)# (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)
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant01)data(plant01)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant02)data(plant02)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant03)data(plant03)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant04)data(plant04)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant05)data(plant05)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant06)data(plant06)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant07)data(plant07)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant08)data(plant08)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant09)data(plant09)
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
plant: Plant species exposed to a given product during 21 days for the vegetative vigour test. Shoot dry weight data is collected
data(plant10)data(plant10)
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
BinaryData, CountData or
ContinuousData.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.
## 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, ... )## 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, ... )
x |
an object of class |
xlab |
a label for the |
ylab |
a label for the |
main |
title for the plot |
concentration |
a numeric value corresponding to some concentration(s) in
|
pool.replicate |
if |
addlegend |
if |
... |
Further arguments to be passed to generic methods |
a plot of class ggplot
DoseResponse objectsThis 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.
## 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, ... )## 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, ... )
x |
an object of class |
xlab |
a label for the |
ylab |
a label for the |
main |
main title for the plot |
log.scale |
if |
addlegend |
if |
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 |
a plot of class ggplot
FitTT objects.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).
## 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, ... )## 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, ... )
x |
an object of class |
xlab |
a label for the |
ylab |
a label for the |
main |
main title for the plot |
display.conc |
Vector of numeric on which the plot is done. Default is
|
spaghetti |
if |
adddata |
if |
addlegend |
if |
log.scale |
if |
... |
Further arguments to be passed to generic methods |
a plot of class ggplot
PPC
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 (-axis) and the corresponding
predicted values (-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.
## S3 method for class 'PPC' plot( x, xlab = "Observation", ylab = "Prediction", main = NULL, dodge.width = 0, ... )## S3 method for class 'PPC' plot( x, xlab = "Observation", ylab = "Prediction", main = NULL, dodge.width = 0, ... )
x |
an object of class |
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 |
... |
Further arguments to be passed to generic methods |
a plot of class ggplot
XCX
Plot the median and 95\ Concentration.
## S3 method for class 'XCX' plot(x, xlab = NULL, ylab = NULL, main = NULL, ...)## S3 method for class 'XCX' plot(x, xlab = NULL, ylab = NULL, main = NULL, ...)
x |
an object of class |
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 |
a plot of class ggplot
FitTT objectsCreate the PPC object to be pass in plot function for plotting the
Posterior Predictive Check.#'
ppc(fit, ...) ## S3 method for class 'ContinuousFitTT' ppc(fit, ...) ## S3 method for class 'CountFitTT' ppc(fit, ...) ## S3 method for class 'BinaryFitTT' ppc(fit, ...)ppc(fit, ...) ## S3 method for class 'ContinuousFitTT' ppc(fit, ...) ## S3 method for class 'CountFitTT' ppc(fit, ...) ## S3 method for class 'BinaryFitTT' ppc(fit, ...)
fit |
An object of class |
... |
Further arguments to be passed to generic methods |
An object of class 'PPC'
FitTT
Prediction base on FitTT
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, ...)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, ...)
fit |
object of class |
... |
Further arguments to be passed to generic methods |
display.conc |
vector of concentrations values (x axis) |
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.
FitTT objectReturn Prior and Posterior density of parameters of FitTT object
Extract posterior of parameters from a FitTT object#'
## 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, ...)## 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, ...)
x |
an object of class |
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 |
size_sample |
graphical backend, can be |
a data frame of class PriorPosterior
Return an object of class Posterior
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.
data(propiconazole)data(propiconazole)
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.
Additional dataset for continuous data
data(reco27)data(reco27)
Predict median and 95\ Concentration.
xcx(fit, x, ...) ## S3 method for class 'FitTT' xcx(fit, x, ...)xcx(fit, x, ...) ## S3 method for class 'FitTT' xcx(fit, x, ...)
fit |
An object used to select a method |
x |
vector of values of LCx or ECX |
... |
Further arguments to be passed to generic methods |
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)
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.
data(subst01_lymnaea)data(subst01_lymnaea)
FitTT objectThis 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
## 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, ...)## 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, ...)
object |
an object of class |
quiet |
when |
... |
Further arguments to be passed to generic methods |
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 |
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.
data(zinc)data(zinc)
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.
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).
data(zinc_daphnia)data(zinc_daphnia)
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.