Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict_ode.survFit

Predict method for survFit objects


Description

This is the generic predict S3 method for the survFit class. It provides predicted survival rate for "SD" or "IT" models under constant or time-variable exposure.

Usage

## S3 method for class 'survFit'
predict_ode(
  object,
  data_predict = NULL,
  spaghetti = FALSE,
  mcmc_size = 1000,
  hb_value = TRUE,
  interpolate_length = 100,
  interpolate_method = "linear",
  hb_valueFORCED = NA,
  ...
)

Arguments

object

An object of class survFit.

data_predict

A dataframe with three columns time, conc and replicate used for prediction. If NULL, prediction is based on x object of class survFit used for fitting.

spaghetti

If TRUE, return a set of survival curves using parameters drawn from the posterior distribution.

mcmc_size

Can be used to reduce the number of mcmc samples in order to speed up the computation. mcmc_size is the number of selected iterations for one chain. Default is 1000. If all MCMC is wanted, set argument to NULL.

hb_value

If TRUE, the background mortality hb is taken into account from the posterior. If FALSE, parameter hb is set to a fixed value. The default is TRUE.

interpolate_length

Length of the time sequence for which output is wanted.

interpolate_method

The interpolation method for concentration. See package deSolve for details. Default is linear.

hb_valueFORCED

If hb_value is FALSE, it fix hb.

...

Further arguments to be passed to generic methods

Examples

# (1) Load the survival data
data("propiconazole_pulse_exposure")

# (2) Create an object of class "survData"
dataset <- survData(propiconazole_pulse_exposure)

## Not run: 
# (3) Run the survFit function
out <- survFit(dataset , model_type = "SD")

# (4) Create a new data table for prediction
data_4prediction <- data.frame(time = 1:10,
                               conc = c(0,5,30,30,0,0,5,30,15,0),
                               replicate= rep("predict", 10))

# (5) Predict on a new data set
predict_out <- predict_ode(object = out, data_predict = data_4prediction,
                           mcmc_size = 1000, spaghetti = TRUE)


## End(Not run)

morse

Modelling Tools for Reproduction and Survival Data in Ecotoxicology

v3.3.1
GPL (>= 2)
Authors
Virgile Baudrot [aut], Sandrine Charles [aut], Marie Laure Delignette-Muller [aut], Wandrille Duchemin [ctb], Benoit Goussen [ctb], Nils Kehrein [ctb], Guillaume Kon-Kam-King [ctb], Christelle Lopes [ctb], Philippe Ruiz [aut], Alexander Singer [ctb], Philippe Veber [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.