plot.shrinkDSM_pred {shrinkDSM}R Documentation

Graphical summary of posterior predictive density

Description

plot.shrinkDSM_pred generates plots visualizing the posterior predictive density generated by predict.shrinkDSM.

Usage

## S3 method for class 'shrinkDSM_pred'
plot(x, dens_args, legend = TRUE, ...)

Arguments

x

a shrinkDSM_pred object.

dens_args

optional named list containing arguments passed to density.

legend

logical value inidicating whether a legend should be added. Defaults to TRUE.

...

further arguments to be passed to plots.

Value

Called for its side effects and returns invisibly.

See Also

Other plotting functions: plot.mcmc.dsm.tvp(), plot.shrinkDSM()

Examples


set.seed(123)
data("gastric")

# Create intervals for piecewise exponential model
intervals <- divisionpoints(gastric$time, gastric$status, 2)

# Estimate model
mod <- shrinkDSM(time ~ radiation, gastric,
                 delta = gastric$status, S = intervals)

# Draw from posterior predictive distribution
newdata <- data.frame(radiation = c(0, 1))
pred <- predict(mod, newdata = newdata)

# Plot predictions
plot(pred)


[Package shrinkDSM version 0.2.0 Index]