Learn R Programming

BGPhazard (version 1.2.3)

GaPloth: Plots for the Hazard and Survival Function Estimates

Description

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

Usage

GaPloth(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 lambda and u (generated by GaMRres).

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 return plots for the resulting hazard rate as it is computed by GaMRes 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

GaMRes, GaPlotDiag

Examples

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

## Example 1
#  data(gehan)
#  timesG <- gehan$time[gehan$treat == "6-MP"]
#  deltaG <- gehan$cens[gehan$treat == "6-MP"]
#  GEX1 <- GaMRes(timesG, deltaG, K = 8, iterations = 3000)
#  GaPloth(GEX1, confint = FALSE)
#  GaPloth(GEX1, fun = "both", confint = TRUE)

## Example 2
#  data(leukemiaFZ)
#  timesFZ <- leukemiaFZ$time
#  deltaFZ <- leukemiaFZ$delta
#  GEX2 <- GaMRes(timesFZ, deltaFZ, type.c = 4)
#  GaPloth(GEX2, fun = "both", confint = TRUE)
# }

Run the code above in your browser using DataLab