Learn R Programming

hesim (version 0.5.5)

tparams_mean: Predicted means

Description

Create a list containing means predicted from a statistical model.

Usage

tparams_mean(value, ...)

Value

An object of class tparams_mean, which is a list containing value, n_samples, and the ID attributes passed to id_attributes.

Arguments

value

Matrix of samples from the distribution of the mean. Columns denote random samples and rows denote means for different observations.

...

Arguments to pass to id_attributes. Each row in value must be a prediction for a strategy_id, patient_id, state_id, and optionally time_id combination.

See Also

A tparams_mean object is a type of transformed parameter object and is a supported class type of the params field of the StateVals class. See the documentation for create_StateVals() and stateval_tbl() for examples of how to createStateVals objects. Predicted means can be summarized across parameter samples using summary.tparams_mean().

Examples

Run this code
# Setup model
hesim_dat <- hesim_data(
  strategies = data.frame(strategy_id = c(1, 2)),
  patients = data.frame(patient_id = c(1, 2)),
  states = data.frame(
    state_id = c(1, 2, 3),
    state_name = c("state1", "state2", "state3")
  )
)

# Cost model
cost_tbl <- stateval_tbl(
  data.frame(strategy_id = hesim_dat$strategies$strategy_id,
             mean = c(5000, 3000),
             se = c(200, 100)
            ),
  dist = "gamma"
)
costmod <- create_StateVals(cost_tbl, n = 2, hesim_data = hesim_dat)

# The 'params' field of the `StateVals` class is a tparams_mean object
class(costmod$params)
costmod$params
summary(costmod$params)

Run the code above in your browser using DataLab