
CPPplotHR(sample = CPPpriorSample(0), npts = 101, tu = "Time Unit", title = NULL)
CPPpriorSample
or CPPpostSample
)NULL
.For a posterior sample, the pointwise posterior mean and equal tail 95% credible band are drawn (as solid lines) and dashed lines are added to represent the analogous posterior summaries for the constant hazard rate model (using a conjugate gamma prior and letting its shape and rate parameters tend to zero). Furthermore, the observations are marked on the time axis ("x" for exact observations, "o" for censored observations).
The range spanned by the time axis always goes from the origin to sample$hyp$T00
.
BayHaz-package
, CPPevalHR
# set RNG seed (for example reproducibility only)
set.seed(1234)
# select a CPP prior distribution
hypars<-CPPpriorElicit(r0 = 0.1, H = 1, T00 = 50, M00 = 2)
# generate a sample of ten hazard rates
prior<-CPPpriorSample(ss = 10, hyp = hypars)
# plot the ten hazard rates
CPPplotHR(prior, tu = "Year")
# load a data set
data(earthquakes)
# generate a posterior sample
post<-CPPpostSample(hypars, times = earthquakes$ti, obs = earthquakes$ob)
# plot some posterior hazard rate summaries
CPPplotHR(post, tu = "Year")
Run the code above in your browser using DataLab