Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

BePloth

Plots for the discrete Hazard and Survival Function Estimates


Description

Plots the resulting hazard function along with the survival function estimates defined by the Markov beta process (Nieto-Barajas and Walker, 2002).

Usage

BePloth(
  M,
  type.h = "dot",
  add.survival = T,
  intervals = T,
  confidence = 0.95,
  summary = FALSE
)

Arguments

M

tibble. Contains the output generated by BeMRres.

type.h

character, "line" = plots the hazard rate of each interval joined by a line, "dot" = plots the hazard rate of each interval with a dot.

add.survival

logical, If TRUE, plots the Nelson-Alen based estimate in the same graphic of the hazard rate and the Kaplan-Meier estimates of the survival function.

intervals

logical. If TRUE, plots confidence bands for the selected functions including Nelson-Aalen and/or Kaplan-Meier estimate.

confidence

Numeric. Confidence band width.

summary

Logical. If TRUE, a summary for hazard and survival functions is returned as a tibble.

Details

This function returns estimators plots for the hazard rate as computed by BeMRes together with the Nelson-Aalen estimate along with their confidence intervals for the data set given. Additionally, it plots the survival function and the Kaplan-Meier estimate with their corresponding credible intervals.

Value

SUM.h

Numeric tibble. Summary for the mean, median, and a confint / 100 confidence interval for each failure time of the hazard function.

SUM.S

Numeric tibble. Summary for the mean, median, and a confint / 100 confidence interval for each failure time of the survival function.

References

- Nieto-Barajas, L. E. & Walker, S. G. (2002). Markov beta and gamma processes for modelling hazard rates. Scandinavian Journal of Statistics 29: 413-424.

See Also

Examples

## Simulations may be time intensive. Be patient.

## Example 1
#  data(psych)
#  timesP <- psych$time
#  deltaP <- psych$death
#  BEX1 <- BeMRes(timesP, deltaP, iterations = 3000, burn.in = 300, thinning = 1)
#  BePloth(BEX1)
#  sum <- BePloth(BEX1, type.h = "line", summary = T)

## Example 2
#  data(gehan)
#  timesG <- gehan$time[gehan$treat == "control"]
#  deltaG <- gehan$cens[gehan$treat == "control"]
#  BEX2 <- BeMRes(timesG, deltaG, type.c = 2, c.r = rep(50, 22))
#  BePloth(BEX2)

BGPhazard

Markov Beta and Gamma Processes for Modeling Hazard Rates

v2.1.0
GPL (>= 2)
Authors
L. E. Nieto-Barajas, J. A. Garcia Bueno, E.A. Morones Ishikawa and J. Pliego
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.