An object of class survival
stores survival probabilities. It is typically
returned by Psm$sim_survival()
or PsmCurves$survival()
; however, it can also
be constructed "manually" from existing data using the survival()
function as described below. The latter option is useful if survival modeling
has been performed by an R
package other than those that integrate with hesim
(
currently flexsurv
). In this case a simulation model can still be developed
by using sim_stateprobs.survival()
to compute simulated state probabilities and
then simulating quality-adjusted life-years and costs in a typical fashion.
survival(
data,
sample = "sample",
strategy_id = "strategy_id",
patient_id = "patient_id",
grp_id = "grp_id",
curve = "curve",
t = "t",
survival = "survival"
)
An object of class survival
that inherits from data.table
and contains
the following columns:
A random sample from the PSA.
The treatment strategy ID.
The patient ID.
The subgroup ID.
One of the N
-1 survival curves in an N-state partitioned
survival model. Each curve corresponds to unique endpoint.
The time at which a survival probability is computed.
The probability of surviving to time t
.
The object also contains a size
attribute that contains the elements
n_samples
, n_strategies
, n_patients
, n_states
, and n_times
denoting
the number of samples, treatment strategies, patients, health states, and times.
A tabular object that can be coerced to a data.table
with
as.data.table()
.
The name of the column corresponding to sample
.
The name of the column corresponding to strategy_id
.
The name of the column corresponding to patient_id
.
The name of the column corresponding to grp_id
.
The name of the column corresponding to curve
.
The name of the column corresponding to t
.
The name of the column corresponding to survival
.
survival
objects are returned by methods in the Psm
and PsmCurves
classes. An example in which a survival
object is constructed "manually"
(presumably from a preexisting survival model fit using software other than flexsurv
)
is provided in the documentation to sim_stateprobs.survival()
.