Learn R Programming

odeGUTS (version 1.1.0)

predict_ode: Predict method for survFit objects

Description

Function from the morse v 3.3.1 package. This is a method to replace function predict used on survFit object when computing issues happen. predict_ode uses the deSolve library to improve robustness. However, time to compute may be longer.

Function from the morse v 3.3.1 package. 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.

Function from the morse v 3.3.1 package. This is a method to replace function predict_Nsurv used on survFit object when computing issues happen. predict_nsurv_ode uses the deSolve library to improve robustness. However, time to compute may be longer.

Usage

predict_ode(object, ...)

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

predict_Nsurv_ode( object, data_predict, spaghetti, mcmc_size, hb_value, hb_valueFORCED, extend_time, interpolate_length, interpolate_method, ... )

# S3 method for survFit predict_Nsurv_ode( object, data_predict = NULL, spaghetti = FALSE, mcmc_size = 1000, hb_value = FALSE, hb_valueFORCED = 0, extend_time = 100, interpolate_length = NULL, interpolate_method = "linear", ... )

Value

The function returns an object of class survFitPredict or survFitPredict_Nsurv with two items:

df_quantile

Predicted quantiles (q50, qinf95, and qsup95)

df_spaghetti

Predicted survival curve (if spaghetti = TRUE)

Arguments

object

An object of class survFit.

...

Further arguments to be passed to generic methods

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 0. The default is FALSE.

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. Default is 0

extend_time

Length of time points interpolated with variable exposure profiles.

Examples

Run this code
library("odeGUTS")
data(fit_odeGUTS)

data_4prediction <- data.frame(time = 1:10,
                               conc = c(0,5,30,30,0,0,5,30,15,0),
                               replicate= rep("predict", 10))

predict_out <- predict_ode(object = fit_odeGUTS, data_predict = data_4prediction,
                           mcmc_size = 200, spaghetti = FALSE)



Run the code above in your browser using DataLab