Learn R Programming

BGPhazard (version 1.2.3)

BePloth: Plots for the Hazard and Survival Function Estimates

Description

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

Usage

BePloth(M, fun = "both", confint = TRUE, h.NA = TRUE, KM = TRUE, 
confidence = 0.95, summary = FALSE, legend = TRUE)

Arguments

M

List. Contains the information given for Pi and u (generated by BeMRres).

fun

"h"=plots hazard function, "S"= plots survival function and "both"=plots both the hazard and survival functions.

confint

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

h.NA

Logical. If TRUE, Nelson-Aalen estimate is plotted over the hazard function.

KM

Logical. If TRUE, Kaplan-Meier estimate is plotted over the survival function.

confidence

Numeric. Confidence band width.

summary

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

legend

Logical. If FALSE, legend is not shown.

Value

SUM.h

Numeric matrix. Summary for the mean, median, and a confint / 100 confidence interval for each segment of the hazard function.

SUM.S

Numeric matrix. Summary for the mean, median, and a confint / 100 confidence interval for each segment of the survival function.

Warning

The argument fun is case-sensitive and requires quotations as its class is character.

Details

This function returns plots for the resulting hazard rate as it is computed by BeMRes and 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 confidence intervals.

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

BeMRes, BePlotDiag

Examples

Run this code
# NOT RUN {
## Simulations may be time intensive. Be patient.

## Example 1
#  data(psych)
#  timesP <- psych$time
#  deltaP <- psych$death
#  BEX1 <- BeMRes(timesP, deltaP, iterations = 3000)
#  BePloth(BEX1, confint = FALSE)
#  BePloth(BEX1, fun = "both", confint = TRUE)

## 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, confint = TRUE, confidence = 0.95)
# }

Run the code above in your browser using DataLab