Learn R Programming

nph (version 2.1)

plot.mixpch: Plot mixpch Objects

Description

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

Usage

# S3 method for 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

References

Robin Ristl, Nicolas Ballarini, Heiko G<U+00F6>tte, Armin Sch<U+00FC>ler, Martin Posch, Franz K<U+00F6>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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab