wmst_surv: Create a Survdef Object for a Piecewise Exponential...

wmst_survR Documentation

Create a Survdef Object for a Piecewise Exponential Distribution

Description

Create a new object which stores user-specified survival distribution information in the format needed for the main function, RMSTpow. survdef is used when the user wishes to specify a piecewise expoenential survival distribution. Either the hazard on fixed intervals or survival probabilities at fixed times can be specified.

Usage

wmst_surv(haz = NA, surv = NA, times = NA)

Arguments

haz

a vector of hazards of length<=10. If a single hazard is specified, the survival distribution is exponential with the specified hazard. If haz has length>2, the survival distribution has constant hazard equal to haz over the intervals ⁠[0, t_1), [t_1, t_2), \dots, [t_m, Inf)⁠ where t_i are the entries of times and times has length m. One of haz, surv must be specified.

surv

a vector of survival probabilities of length<=10 corresponding to times. If surv is specified, the survival distribution has constant hazard over the intervals ⁠[0, t_1), [t_1, t_2), \dots, [t_m, Inf)⁠ where t_i are the entries of times and times has length m+1. The hazards are calculated so that the curve passes through each entry in surv at the corresponding time from times. One of haz, surv must be specified.

times

a vector of the same length as surv (if surv is specified) or one element shorter than haz (if haz is specified). No times term is required if a single hazard is specified in haz.

Value

a list with components:

S

a vectorized function that takes time as input and returns the survival probability at that time

h

a vectorized function that takes time as input and returns the hazard at that time


pauknemj/survWM2 documentation built on March 21, 2023, 5:29 a.m.