View source: R/pwr2n.NPH.R View source: R/oxy-pwr2n.NPH.R
plot.NPHpwr | R Documentation |
Displays graphs of survival, hazards, drop-out and censor over time as specified in the calculation.
## S3 method for class 'NPHpwr'
plot(x, type = c("hazard", "survival", "dropout", "event", "censor"), ...)
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 |
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.
plots are produced on the current graphics device
pwr2n.NPH
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.