plotCoef: Plot Coefficient Function

Description Usage Arguments Details Value See Also Examples

View source: R/plot.R

Description

Plot coefficient values formatted in a data frame returned by function coef.

Usage

1
plotCoef(object, smooth = FALSE, ...)

Arguments

object

A data.frame returned by function coef.

smooth

A logical value, default FALSE. If TRUE, plot the coefficients as smooth lines; otherwise, plot the coefficients as piece-wise constant step functions.

...

Other arguments.

Details

To plot estimated coefficient functions from different models together, one can first combine the data frames returned by coef, and then call plotCoef, for example, plotCoef(rbind(coef(fit1), coef(fit2))).

To specify the time range of the plot, one can either utilize the ggplot functionality, say plotCoef(coef(fit)) + xlim(2, 10); or manipulate the data frame first before calling plotCoef, e.g., plotCoef(subset(coef(fit), Time > 2 & Time < 10)).

Value

A ggplot object.

See Also

coef.bayesCox, coef.splineCox, and coef.tvTran.

Examples

1
## See the examples in bayesCox, splineCox, and tvTran.

Example output

Loading required package: survival

dynsurv documentation built on Sept. 7, 2020, 5:07 p.m.

Related to plotCoef in dynsurv...