A data frame with one row per simulated subject and columns time,
the event or censoring time, and event, coded 1 for an event and 0
for administrative censoring.
Arguments
n
A single non-negative integer giving the number of event times to
simulate. The default is 1; n = 0 returns a zero-row data frame.
hazard
A numeric vector of finite, non-negative event rates, with one
value per interval defined by cutpoints. The default is 1, giving a
constant unit rate. If at least one outcome is requested and the final rate
is zero, maxtime must be supplied so that subjects without an event can
be administratively censored.
cutpoints
NULL (the default), or a numeric vector of finite,
positive, strictly increasing interior times at which the hazard rate
changes. The number of hazard rates must be one greater than the number of
cutpoints. Use NULL for a constant hazard.
maxtime
NULL (the default), or a single finite, positive numeric
administrative censoring time. When supplied, it must be later than every
cutpoint.
Details
PWEALL represents the generating hazard with pieces closed on the
left and open on the right. Because the event-time distribution is
continuous, the value of the hazard at an isolated cutpoint does not alter
the cumulative hazard, distribution, or generated samples. When realized
event times are later assigned to analysis intervals, goldilocks follows
the survival counting-process convention, open on the left and closed on
the right, so an event exactly at a cutpoint belongs to the interval ending
there. See pwe_impute() for the conditional sampling details.