Predict method for survFit objects
This is the generic predict S3 method for the survFit class.
It provides simulation for "SD" or "IT" models under constant or time-variable exposure.
It provides the simulated number of survivors for "SD" or "IT" models under constant or time-variable exposure.
It provides the simulated number of survivors for "SD" or "IT" models under constant or time-variable exposure.
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.
## S3 method for class 'survFit' predict( object, data_predict = NULL, spaghetti = FALSE, mcmc_size = NULL, hb_value = TRUE, ratio_no.NA = 0.95, hb_valueFORCED = NA, extend_time = 100, ... ) predict_Nsurv(object, ...) ## S3 method for class 'survFit' predict_Nsurv( object, data_predict = NULL, spaghetti = FALSE, mcmc_size = NULL, hb_value = TRUE, hb_valueFORCED = NA, extend_time = 100, ... ) predict_Nsurv_ode( object, data_predict, spaghetti, mcmc_size, hb_value, hb_valueFORCED, extend_time, interpolate_length, interpolate_method, ... )
object |
An object of class |
data_predict |
A dataframe with three columns |
spaghetti |
If |
mcmc_size |
Can be used to reduce the number of mcmc samples in order to speed up
the computation. |
hb_value |
If |
ratio_no.NA |
A numeric between 0 and 1 standing for the proportion of non-NA values required to compute quantile. The default is 0.95. |
hb_valueFORCED |
If |
extend_time |
Length of time points interpolated with variable exposure profiles. |
... |
Further arguments to be passed to generic methods |
interpolate_length |
Length of the time sequence for which output is wanted. |
interpolate_method |
The interpolation method for concentration. See package |
The function returns an object of class survFitPredict_Nsurv, which is
a list with the two following data.frame:
df_quantile |
A |
df_spaghetti |
NULL if arguement |
# (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 dataset
predict_out <- predict(object = out, data_predict = data_4prediction, spaghetti = TRUE)
## End(Not run)
# (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),
Nsurv = c(20,20,17,16,15,15,15,14,13,12))
# (5) Predict Nsurv on a new data set
predict_out <- predict_Nsurv(object = out, data_predict = data_4prediction, spaghetti = TRUE)
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.