plot.NPHpwr {nphPower} | R Documentation |
Graphical Display of Design Parameters in Sample Size Calculation
Description
Displays graphs of survival, hazards, drop-out and censor over time as specified in the calculation.
Usage
## S3 method for class 'NPHpwr'
plot(x, type = c("hazard", "survival", "dropout", "event", "censor"), ...)
Arguments
x |
object of the |
type |
a vector of string, specifying the graphs to display. The options
include " |
... |
additional graphical arguments passed to the plot function |
Details
The type
argument provides five options to visualize the trial in design.
Option survival
shows the survival probabilities of treatment and control
group over time. Option hazard
provides the hazard rates and hazard ratio
over time. Option dropout
shows the proportion of drop-out subjects across
the trial duration.
Option censor
shows the proportion of censored subjects over time.
Value
plots are produced on the current graphics device
See Also
Examples
# generate weight function
wlr <- gen.wgt(method = "LR" )
t_enrl <- 12; t_fup <- 18; lmd0 <- log(2)/12
# delayed treatment effects, the crossign point is at 6.
f_hr_delay <- function(x){(x<=6)+(x>6)*0.75}
f_haz0 <- function(x){lmd0*x^0}
snph1 <- pwr2n.NPH(entry = t_enrl, fup = t_fup, Wlist = wlr,
k = 100, ratio = 2, CtrlHaz = f_haz0,
hazR = f_hr_delay)
# display the hazards plot only
plot(snph1, type="hazard")
# display all plots
plot(snph1)