plotHaz: Plot the Baseline Cumulative Hazard Function for the Terminal...

View source: R/plot.R

plotHazR Documentation

Plot the Baseline Cumulative Hazard Function for the Terminal Time

Description

Plot the baseline cumulative hazard function for an reReg object. The 95% confidence interval on the baseline cumulative rate function

Usage

plotHaz(
  x,
  newdata = NULL,
  frailty = NULL,
  showName = FALSE,
  type = c("unrestricted", "bounded", "scaled"),
  smooth = FALSE,
  control = list(),
  ...
)

Arguments

x

an object of class reReg, returned by the reReg function.

newdata

an optional data frame contains variables to include in the calculation of the cumulative rate function. If omitted, the baseline rate function will be plotted.

frailty

an optional vector to specify the shared frailty for newdata. If newdata is given and frailty is not specified, the

showName

an optional logical value indicating whether to label the curves when newdata is specified.

type

a character string specifying the type of rate function to be plotted. Options are "unrestricted", "scaled", "bounded". See Details.

smooth

an optional logical value indicating whether to add a smooth curve obtained from a monotone increasing P-splines implemented in package scam.

control

a list of control parameters.

...

graphical parameters to be passed to methods. These include xlab, ylab, main, and more. See Details.

Details

The argument control consists of options with argument defaults to a list with the following values:

xlab

customizable x-label, default value is "Time".

ylab

customizable y-label, default value is empty.

main

customizable title, default value is "Baseline cumulative hazard function".

These arguments can also be passed down without specifying a control list.

Value

A ggplot object.

See Also

reReg plot.reReg

Examples

data(simDat)
fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2

fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0)
## Plot both the baseline cumulative rate and hazard function
plot(fit)
## Plot baseline cumulative hazard function
plotHaz(fit)
plotHaz(fit, smooth = TRUE)

stc04003/reReg documentation built on Sept. 20, 2023, 7:30 a.m.