ModelData: Creates a data set for binary data analysis

ModelDataR Documentation

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)


morseDR documentation built on June 8, 2025, 10:20 a.m.