Learn R Programming

reReg (version 1.2.1)

plotRate: Plotting the Baseline Cumulative Rate Function for the Recurrent Event Process

Description

Plot the baseline rate function for an reReg object. The 95% confidence interval on the baseline cumulative rate function is provided when the reReg object is fitted with standard error estimation.

Usage

plotRate(x, smooth = FALSE, control = list(), ...)

Arguments

x

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

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.

Value

A ggplot object.

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 rate function".

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

See Also

reReg plot.reReg

Examples

Run this code
# NOT RUN {
data(simDat)
fm <- Recur(Time, id, event, status) ~ x1 + x2

fit <- reReg(fm, data = simDat, method = "cox.HW")
## Plot both the baseline cumulative rate and hazard function
plot(fit)
## Plot baseline cumulative rate function
plotRate(fit)
plotRate(fit, smooth = TRUE)
## Plot with user-specified labels
plotRate(fit, xlab = "User xlab", ylab = "User ylab", main = "User title")
plotRate(fit, control = list(xlab = "User xlab", ylab = "User ylab", main = "User title"))
# }

Run the code above in your browser using DataLab