plot.mixpch: Plot mixpch Objects

View source: R/paket_nph_2-1_1.R

plot.mixpchR Documentation

Plot mixpch Objects

Description

Plots survival and other functions stored in mixpch objects versus time.

Usage

## S3 method for class 'mixpch'
plot(
  x,
  fun = c("S", "F", "haz", "cumhaz"),
  add = FALSE,
  ylab = fun,
  xlab = "Time",
  ...
)

Arguments

x

an object of class mixpch.

fun

character string in c("S","F","haz","cumhaz") indicating which function to plot. Select "S" for the survival function, "F" for the distribution functin, "haz" for the hazard function or "cumhaz" for the cumulative hazard function.

add

logical, indicates if the drawing should be added to an existing plot.

ylab

label of the y-axis

xlab

label of the x-axis

...

further arguments passed to the plotting functions

Author(s)

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

References

Robin Ristl, Nicolas Ballarini, Heiko Götte, Armin Schüler, Martin Posch, Franz König. Delayed treatment effects, treatment switching and heterogeneous patient populations: How to design and analyze RCTs in oncology. Pharmaceutical statistics. 2021; 20(1):129-145.

See Also

pchaz, subpop_pchaz, pop_pchaz

Examples

A <- pop_pchaz(Tint = c(0, 90, 1500),
  lambdaMat1 = matrix(c(0.2, 0.1, 0.4, 0.1), 2, 2) / 365,
 lambdaMat2 = matrix(c(0.5, 0.2, 0.6, 0.2), 2, 2) / 365,
 lambdaProg = matrix(c(0.5, 0.5, 0.4, 0.4), 2, 2) / 365,
 p = c(0.8, 0.2), 
 timezero = FALSE, discrete_approximation = TRUE)
plot(A)
plot(A, "haz", add = TRUE)


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