# BPSplotHR: Function to Plot BPS Hazard Rates In BayHaz: R Functions for Bayesian Hazard Rate Estimation

## Description

A function to plot a (prior or posterior) sample of first order autoregressive BPS hazard rates.

## Usage

 `1` ```BPSplotHR(sample = BPSpriorSample(0), npts = 101, tu = "Time Unit", title = NULL) ```

## Arguments

 `sample` sample of BPS hazard rates (as generated by `BPSpriorSample` or `BPSpostSample`) `npts` number of time points where the hazard rates in the sample should be evaluated `tu` name of the time unit to be used for labelling the time axis `title` main title for the plot

## Details

For a prior sample, the individual trajectories are plotted (as solid lines) and dashed lines are added to represent the pointwise prior mean and +/- one standard deviation band.

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`.

## Value

Always `NULL`.

`BayHaz-package`, `BPSevalHR`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```# set RNG seed (for example reproducibility only) set.seed(1234) # select a BPS prior distribution hypars<-BPSpriorElicit(r0 = 0.1, H = 1, T00 = 50, ord = 4, G = 3, c = 0.9) # generate a sample of ten hazard rates prior<-BPSpriorSample(ss = 10, hyp = hypars) # plot the ten hazard rates BPSplotHR(prior, tu = "Year") ```

### Example output

```Loading required package: splines
```

BayHaz documentation built on May 2, 2019, 7:07 a.m.