plot.nphparams: Plot nphparams Objects

View source: R/simultane_Inferenz_Funktionen_nph_1-3.R

plot.nphparamsR Documentation

Plot nphparams Objects

Description

Plots the estimated survival distributions, shows numbers at risk and indicates the requested parameters for quantifying differences between the survival curves.

Usage

## S3 method for class 'nphparams'
plot(
  x,
  xlim = NULL,
  ylim = c(0, 1),
  trt_name = "Treatment",
  ctr_name = "Control",
  xlab = "Time",
  ylab = "Survival",
  main = "",
  col_ctr = 1,
  col_trt = 2,
  atrisktimes = 0:3,
  bold = 2,
  showlines = FALSE,
  show_rmst_diff = FALSE,
  ...
)

Arguments

x

an object of class nphparams.

xlim

limits of the x-axis, must be a numeric vector of length two

ylim

limits of the y-axis, must be a numeric vector of length two

trt_name

character, an optional name for group 1 to be shown with the number at risk table in the plot. Default is "Treatment".

ctr_name

character, an optional name for group 0 to be shown with the number at risk table in the plot. Default is "Control".

xlab

character, an optional label for the x-axis. Default is "Time".

ylab

character, an optional label for the x-axis. Default is "Survival".

main

character, an optional title of the plot. Default is "", showing no title.

col_ctr

the color of the survival curve estimate of group 0. Default is 1 (black).

col_trt

the color of the survival curve estimate of group 1. Default is 2 (red).

atrisktimes

numeric vector of time-points for which the number at risk is displayed.

bold

numeric, passed to linewidth and font settings. Default is 2, resulting in lines of width 2 and boldfont. Use 1 for line-width 1 and standard font.

showlines

logical, indicating whether the time-points or the quantile-probabilites defined for the requested parametes should be shown in terms of vertical or horizontal lines. Default is FALSE.

show_rmst_diff

logical, indicating whether the estiamted difference in restricted mean survival times should by visualized by a gray background area.

...

further arguments, not used

Details

When setting show_lines, line type 2 (dashed) is used for survival probabilities and quantiles, line type 3 (dotted) is used for the score test, average hazard ratio and Cox model hazard ratio and line type 5 (long dashed) is used for restricted mean survival time.

Author(s)

Robin Ristl, robin.ristl@meduniwien.ac.at

See Also

nphparams, plot.nphparams

Examples

data(pembro)
set1<-nphparams(time=time, event=event, group=group,data=pembro,
param_type=c("score","S"),
param_par=c(3.5,2),
param_alternative=c("less","greater"),
closed_test=TRUE,alternative_test="one.sided")
print(set1)
plot(set1,trt_name="Pembrolizumab",ctr_name="Cetuximab")

set2<-nphparams(time=time, event=event, group=group, data=pembro,  
param_type=c("S","S","S","Q","RMST"),
param_par=c(0.5,1,2,0.5,3.5))
print(set2)
plot(set2,showlines=TRUE,show_rmst_diff=TRUE)


nph documentation built on May 17, 2022, 1:06 a.m.