Learn R Programming

rpact (version 2.0.6)

getPiecewiseSurvivalTime: Get Piecewise Survival Time

Description

Returns a PiecewiseSurvivalTime object that contains the all relevant parameters of an exponential survival time cumulative distribution function.

Usage

getPiecewiseSurvivalTime(
  piecewiseSurvivalTime = NA_real_,
  ...,
  lambda1 = NA_real_,
  lambda2 = NA_real_,
  hazardRatio = NA_real_,
  pi1 = NA_real_,
  pi2 = NA_real_,
  median1 = NA_real_,
  median2 = NA_real_,
  eventTime = C_EVENT_TIME_DEFAULT,
  kappa = 1,
  delayedResponseAllowed = FALSE
)

Arguments

piecewiseSurvivalTime

A vector that specifies the time intervals for the piecewise definition of the exponential survival time cumulative distribution function (see details).

...

Ensures that all arguments after piecewiseSurvivalTime are be named and that a warning will be displayed if unknown arguments are passed.

lambda1

The assumed hazard rate in the treatment group, there is no default. lambda1 can also be used to define piecewise exponentially distributed survival times (see details).

lambda2

The assumed hazard rate in the reference group, there is no default. lambda2 can also be used to define piecewise exponentially distributed survival times (see details).

hazardRatio

The vector of hazard ratios under consideration. If the event or hazard rates in both treatment groups are defined, the hazard ratio needs not to be specified as it is calculated.

pi1

The assumed event rate in the treatment group, default is seq(0.4, 0.6, 0.1).

pi2

The assumed event rate in the control group, default is 0.2.

median1

The assumed median survival time in the treatment group, there is no default.

median2

The assumed median survival time in the reference group, there is no default.

eventTime

The assumed time under which the event rates are calculated, default is 12.

kappa

The shape parameter of the Weibull distribution, default is 1. The Weibull distribution cannot be used for the piecewise definition of the survival time distribution. Note that the parameters shape and scale in Weibull are equivalent to kappa and 1 / lambda, respectively, in rpact.

delayedResponseAllowed

If TRUE, delayed response is allowed; otherwise it will be validatet that the definition is not delayed, default is FALSE.

Value

Returns a PiecewiseSurvivalTime object.

Details

piecewiseSurvivalTime The first element of this vector must be equal to 0. piecewiseSurvivalTime can also be a list that combines the definition of the time intervals and hazard rates in the reference group. The definition of the survival time in the treatment group is obtained by the specification of the hazard ratio (see examples for details).

Examples

Run this code
# NOT RUN {
pwst <- getPiecewiseSurvivalTime(lambda2 = 0.5, hazardRatio = 0.8)
pwst

pwst <- getPiecewiseSurvivalTime(lambda2 = 0.5, lambda1 = 0.4)
pwst

pwst <- getPiecewiseSurvivalTime(pi2 = 0.5, hazardRatio = 0.8)
pwst

pwst <- getPiecewiseSurvivalTime(pi2 = 0.5, pi1 = 0.4)
pwst

pwst <- getPiecewiseSurvivalTime(pi1 = 0.3)
pwst

pwst <- getPiecewiseSurvivalTime(hazardRatio = c(0.6, 0.8), lambda2 = 0.4)
pwst

pwst <- getPiecewiseSurvivalTime(piecewiseSurvivalTime = c(0, 6, 9), 
    lambda2 = c(0.025, 0.04, 0.015), hazardRatio = 0.8)
pwst

pwst <- getPiecewiseSurvivalTime(piecewiseSurvivalTime = c(0, 6, 9), 
    lambda2 = c(0.025, 0.04, 0.015), 
    lambda1 = c(0.025, 0.04, 0.015) * 0.8)
pwst

pwst <- getPiecewiseSurvivalTime(list(
    "0 - <6"   = 0.025, 
    "6 - <9"   = 0.04, 
    "9 - <15"  = 0.015, 
    "15 - <21" = 0.01, 
    ">=21"     = 0.007), hazardRatio = 0.75)
pwst

# }
# NOT RUN {
# The object created by getPiecewiseSurvivalTime() can be used directly in getSampleSizeSurvival():
getSampleSizeSurvival(piecewiseSurvivalTime = pwst)

# The object created by getPiecewiseSurvivalTime() can be used directly in getPowerSurvival():
getPowerSurvival(piecewiseSurvivalTime = pwst, 
    maxNumberOfEvents = 40, maxNumberOfSubjects = 100)

# }
# NOT RUN {
 
# }

Run the code above in your browser using DataLab