plot.shrinkDSM_pred: Graphical summary of posterior predictive density

Description Usage Arguments Value See Also Examples

View source: R/predict_shrinkDSM.R

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)

shrinkDSM documentation built on Sept. 6, 2021, 9:07 a.m.