Survival Helper Functions for Conversion of Pi, Lambda, Median
Source:R/f_design_general_utilities.R
utilitiesForSurvivalTrials.Rd
Functions to convert pi, lambda and median values into each other.
Usage
getLambdaByPi(piValue, eventTime = 12, kappa = 1)
getLambdaByMedian(median, kappa = 1)
getHazardRatioByPi(pi1, pi2, eventTime = 12, kappa = 1)
getPiByLambda(lambda, eventTime = 12, kappa = 1)
getPiByMedian(median, eventTime = 12, kappa = 1)
getMedianByLambda(lambda, kappa = 1)
getMedianByPi(piValue, eventTime = 12, kappa = 1)
Arguments
- piValue, pi1, pi2, lambda, median
Value that shall be converted.
- eventTime
The assumed time under which the event rates are calculated, default is
12
.- kappa
A numeric value > 0. A
kappa != 1
will be used for the specification of the shape of the Weibull distribution. Default is1
, i.e., the exponential survival distribution is used instead of the Weibull distribution. Note that the Weibull distribution cannot be used for the piecewise definition of the survival time distribution, i.e., onlypiecewiselambda
(as a single value) andkappa
can be specified. This function is equivalent topweibull(t, shape = kappa, scale = 1 / lambda)
of thestats
package, i.e., the scale parameter is1 / 'hazard rate'
.
For example,getPiecewiseExponentialDistribution(time = 130, piecewiseLambda = 0.01, kappa = 4.2)
andpweibull(q = 130, shape = 4.2, scale = 1 / 0.01)
provide the sample result.
Value
Returns a numeric
value or vector will be returned.
Details
Can be used, e.g., to convert median values into pi or lambda values for usage in
getSampleSizeSurvival()
or getPowerSurvival()
.