sim_KM: Returns random deviates from a survival curve

Description Usage Arguments Value

Description

Takes in event times and corresponding survival probs (as from a KM curve) and returns n random deviates

Usage

1
2
sim_KM(survival, time, smalltimes, bigtimes, nsims, mindraw = 0,
  maxdraw = 1, draws = NULL)

Arguments

survival

Vector of survival probabilities, as from a KM curve

time

Vector of event times corresponding to the survival probabilities

smalltimes

Value to be returned if survival is higher/time is smaller than any observed. Suggestions: 0, min(times), NA

bigtimes

Value to be returned if survival is lower/time is higher than any observed. Suggestions: Inf, max(times), NA

nsims

Number of deviates to return

mindraw

Minimum draw allowed on the survival scale

maxdraw

Maximum draw allowed on the survival scale

draws

If draws on the survival scale have already been made, specify as a vector here

Value

Times to event representative of the input curve


cancerpolicy/bcimodel documentation built on June 30, 2019, 12:39 a.m.