This function creates a plot of the time-varying coefficients from a fitted coxtv
model.
# S3 method for coxtv
plot(
x,
parm,
CI = TRUE,
level = 0.95,
exponentiate = FALSE,
xlab,
ylab,
xlim,
ylim,
allinone = FALSE,
title,
linetype,
color,
fill,
time,
...
)
model obtained from coxtv
.
covariate names fitted in the model to be plotted. If NULL
, all covariates are plotted.
if TRUE
, confidence intervals are displayed. The default value is TRUE
.
the level of confidence intervals. The default value is 0.95
.
if TRUE
, exponential scale of the fitted coefficients (hazard ratio) for each covariate is plotted.
If FALSE
, the fitted time-varying coefficients (log hazard ratio) are plotted.
the title for the x axis.
the title for the y axis.
the limits for the x axis.
the limits for the y axis.
if TRUE
, the time-varying trajectories for different covariates are combined into a single plot. The default value is FALSE
.
the title for the plot.
the line type for the plot.
the aesthetics parameter for the plot.
the aesthetics parameter for the plot.
the time points for which the time-varying coefficients to be plotted. The default value is the unique observed event times in the dataset fitting the time-varying effects model.
other graphical parameters to plot
data(ExampleData)
z <- ExampleData$z
time <- ExampleData$time
event <- ExampleData$event
fit <- coxtv(event = event, z = z, time = time)
#> Iter 1: Obj fun = -3.2982771; Stopping crit = 1.0000000e+00;
#> Iter 2: Obj fun = -3.2916285; Stopping crit = 2.1424865e-02;
#> Iter 3: Obj fun = -3.2916034; Stopping crit = 8.0884492e-05;
#> Iter 4: Obj fun = -3.2916034; Stopping crit = 1.8232153e-09;
#> Algorithm converged after 4 iterations!
plot(fit)