reproFitTT: Fits a Bayesian concentration-effect model for target-time...

View source: R/reproFitTT.R

reproFitTTR Documentation

Fits a Bayesian concentration-effect model for target-time reproduction analysis

Description

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 reproduction outputs over time, with potential mortality all along the experiment.

Usage

reproFitTT(
  data,
  stoc.part = "bestfit",
  target.time = NULL,
  ecx = c(5, 10, 20, 50),
  n.chains = 3,
  quiet = FALSE
)

Arguments

data

an object of class reproData

stoc.part

stochastic part of the model. Possible values are "bestfit", "poisson" and "gammapoisson"

target.time

defines the target time point at which to analyse the repro data. By default the last time point

ecx

desired values of x (in percent) for which to compute ECx

n.chains

number of MCMC chains. The minimum required number of chains is 2

quiet

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

Details

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 reproFitTT 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 reproFitTT function 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.

Value

The function returns an object of class reproFitTT which is a list of the following objects:

DIC

DIC value of the selected model

estim.ECx

a table of the estimated 5, 10, 20 and 50 % effective concentrations (by default) and their 95 % credible intervals

estim.par

a table of the estimated parameters as medians and 95 % credible intervals

mcmc

an object of class mcmc.list with the posterior distribution

model

a JAGS model object

warnings

a data.frame with warning messages

model.label

a character string, "P" if the Poisson model is used, "GP" if the gamma-Poisson is used

parameters

a list of the parameter names used in the model

n.chains

an integer value corresponding to the number of chains used for the MCMC computation

n.iter

a list of two indices indicating the beginning and the end of monitored iterations

n.thin

a numerical value corresponding to the thinning interval

jags.data

a list of the data passed to the jags model

transformed.data

the survData object passed to the function

dataTT

the dataset with which the parameters are estimated

Examples


# (1) Load the data
data(cadmium1)

# (2) Create an object of class "reproData"
dataset <- reproData(cadmium1)


# (3) Run the reproFitTT function with the log-logistic gamma-Poisson model
out <- reproFitTT(dataset, stoc.part = "gammapoisson",
                  ecx = c(5, 10, 15, 20, 30, 50, 80), quiet = TRUE)



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