predict: Predict method for 'survFit' objects

Description Usage Arguments Value Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
predict_ode(object, ...)

## S3 method for class '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 class '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",
  ...
)

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.

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)

Examples

1
2
3
4
5
6
7
8
9
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)

odeGUTS documentation built on Sept. 10, 2021, 5:08 p.m.