View source: R/piecewise_exponential_class.R
s_piecewise | R Documentation |
Creates a SURVIVAL object with an Piecewise Exponential distribution.
s_piecewise(...)
... |
Parameters to define the distribution. See the Parameters for details |
a SURVIVAL object of the piecewise exponential distribution family. See the
documentation of s_factory
for the methods available for SURVIVAL objects
To create an piecewise exponential survival object the following options are available:
breaks
and hazards
to specify the exponential (constant) hazard until each break, or
surv
, breaks
and segments
for the proportion surviving (no events) at the end of last segment or
fail
, breaks
and segments
for the proportion failing (events) at the end of last segment
If surv
or fail
parameters are indicated, the segments
are scaled to hazards in order
to mach the surviving or failing proportion at the end of the last segment.
Define the last break point as Inf
to fully define the distribution, otherwise
an error will be produce if function after the last break is requested
The parameters should be spell correctly as partial matching is not available
s_piecewise(breaks = c(1,2,3,Inf), hazards = c(0.5,0.6,0.5,0.1))
s_piecewise(surv = 0.4, breaks = c(1,2,3,Inf), segments = c(1,2,1,2))
s_piecewise(fail = 0.6, breaks = c(1,2,3,Inf), segments = c(1,2,1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.