Learn R Programming

spatsurv (version 2.0)

predict.mcmcspatsurv: predict.mcmcspatsurv function

Description

A function to produce predictions from MCMC output. These could include quantiles of the individual density, survival or hazard functions or quantiles of the density function (if available analytically).

Usage

# S3 method for mcmcspatsurv
predict(
  object,
  type = "density",
  t = NULL,
  n = 110,
  indx = NULL,
  probs = c(0.025, 0.5, 0.975),
  plot = TRUE,
  pause = TRUE,
  bw = FALSE,
  ...
)

Value

the required predictions

Arguments

object

an object of class mcmcspatsurv

type

can be "density", "hazard", "survival" or "densityquantile". Default is "density". Note that "densityquantile" is not always analytically tractable for some choices of baseline hazard function.

t

optional vector of times at which to compute the quantiles, Defult is NULL, in which case a uniformly spaced vector of length n from 0 to the maximum time is used

n

the number of points at which to compute the quantiles if t is NULL

indx

the index number of a particular individual or vector of indices of individuals for which the quantiles should be produced

probs

vector of probabilities

plot

whether to plot the result

pause

logical whether to pause between plots, the default is TRUE

bw

Logical. Plot in black/white/greyscale? Default is to produce a colour plot. Useful for producing plots for journals that do not accept colour plots.

...

other arguments, not used here

See Also

print.mcmcspatsurv, quantile.mcmcspatsurv, summary.mcmcspatsurv, vcov.mcmcspatsurv, frailtylag1, spatialpars, hazardpars, fixedpars, randompars, baselinehazard, priorposterior, posteriorcov, MCE, hazardexceedance