Learn R Programming

hesim (version 0.5.5)

create_IndivCtstmTrans: Create IndivCtstmTrans object

Description

A generic function for creating an object of class IndivCtstmTrans.

Usage

create_IndivCtstmTrans(object, ...)

# S3 method for flexsurvreg_list create_IndivCtstmTrans( object, input_data, trans_mat, clock = c("reset", "forward"), n = 1000, uncertainty = c("normal", "none"), ... )

# S3 method for flexsurvreg create_IndivCtstmTrans( object, input_data, trans_mat, clock = c("reset", "forward"), n = 1000, uncertainty = c("normal", "none"), ... )

# S3 method for params_surv create_IndivCtstmTrans( object, input_data, trans_mat, clock = c("reset", "forward", "mix", "mixt"), reset_states = NULL, transition_types = NULL, ... )

# S3 method for params_surv_list create_IndivCtstmTrans( object, input_data, trans_mat, clock = c("reset", "forward", "mix", "mixt"), reset_states = NULL, transition_types = NULL, ... )

Value

Returns an R6::R6Class object of class IndivCtstmTrans.

Arguments

object

An object of the appropriate class containing either a fitted multi-state model or parameters of a multi-state model.

...

Further arguments passed to IndivCtstmTrans$new() in IndivCtstmTrans.

input_data

An object of class expanded_hesim_data returned by expand.hesim_data.

trans_mat

The transition matrix describing the states and transitions in a multi-state model in the format from the mstate package. See IndivCtstmTrans.

clock

"reset" for a clock-reset model, "forward" for a clock-forward model, "mix" for a mixture by state, and "mixt" for a mixture by transition of clock-reset and clock-forward models. See the field clock in IndivCtstmTrans.

n

Number of random observations to draw. Not used if uncertainty = "none".

uncertainty

Method determining how parameter uncertainty should be handled. If "normal", then parameters are randomly drawn from their multivariate normal distribution. If "none", then only point estimates are returned.

reset_states

A vector denoting the states in which time resets. See the field reset_states in IndivCtstmTrans.

transition_types

A vector denoting the type for each transition. See the field transition_types in IndivCtstmTrans.

Details

Disease models may either be created from a fitted statistical model or from a parameter object. In the case of the former, input_data is a data frame like object that is used to look for variables from the statistical model that are required for simulation. In this sense, input_data is very similar to the newdata argument in most predict() methods (e.g., see predict.lm()). In other words, variables used in the formula of the statistical model must also be in input_data.

In the case of the latter, the columns of input_data must be named in a manner that is consistent with the parameter object. In the typical case (e.g., with params_surv or params_mlogit), the parameter object contains coefficients from a regression model, usually stored as matrix where rows index parameter samples (i.e., for a probabilistic sensitivity analysis) and columns index model terms. In such instances, there must be one column from input_data with the same name as each model term in the coefficient matrix; that is, the columns in input_data are matched with the columns of the coefficient matrices by name. If there are model terms in the coefficient matrices that are not contained in input_data, then an error will be thrown.

See Also

See IndivCtstmTrans and IndivCtstm for examples.