plot.tsesimp: Plot method for tsesimp objects

View source: R/plot.tsesimp.R

plot.tsesimpR Documentation

Plot method for tsesimp objects

Description

Generate box plot for AFT model deviance residuals and Kaplan-Meier (KM) plot for potential outcomes of a tsesimp object.

Usage

## S3 method for class 'tsesimp'
plot(x, time_unit = "day", show_hr = TRUE, show_risk = TRUE, ...)

Arguments

x

An object of class tsesimp.

time_unit

The time unit used in the input data. Options are "day" (default), "week", "month", or "year".

show_hr

Logical; whether to show hazard ratio on the KM plot. Default is TRUE.

show_risk

Logical; whether to show number at risk table below the KM plot. Default is TRUE.

...

Ensures that all arguments starting from "..." are named.

Value

A list of two ggplot2 objects, one for box plot and the other for KM plot.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com


trtswitch documentation built on Jan. 10, 2026, 5:08 p.m.