MJM_predict {MJMbamlss}R Documentation

Prediction of MJM model

Description

Note: Writing a predict function is a bit tricky. For longitudinal prediction, if subject specific predictions are wanted, then the PCRE terms must be attached to newdata and already evaluated. If the model uses standardized survival matrices, the different linear predictors should be predicted using different data sets.

Usage

MJM_predict(
  object,
  newdata,
  type = c("link", "parameter", "probabilities", "cumhaz"),
  dt,
  id,
  FUN = function(x) {
     mean(x, na.rm = TRUE)
 },
  subdivisions = 7,
  cores = NULL,
  chunks = 1,
  verbose = FALSE,
  ...
)

Arguments

object

bamlss-model object to be predicted.

newdata

Dataset for which to create predictions. Not needed for conditional survival probabilities.

type

Character string indicating which type of predictions to compute. link returns estimates for all predictors with the respective link functions applied, "parameter" returns the estimates for all pedictors, "probabilities" returns the survival probabilities conditional on the survival up to the last longitudinal measurement, and "cumhaz" return the cumulative hazard up to the survival time or for a time window after the last longitudinal measurement. If type is set to "loglik", the log-likelihood of the joint model is returned. Note that types "probabilities" and "cumhaz" are not yet implemented.

dt

The time window after the last observed measurement for which predictions should be computed.

id

Integer or character, that specifies the individual for which the plot should be created.

FUN

A function that should be applied on the samples of predictors or parameters, depending on argument type.

subdivisions

Number of Gaussian quadrature points for survival integral calculation.

cores

Specifies the number of cores that should be used for prediction. Note that this functionality is based on the parallel package.

chunks

Should computations be split into chunks? Prediction is then processed sequentially.

verbose

Print information during runtime of the algorithm.

...

Currently not used.


[Package MJMbamlss version 0.1.0 Index]