tparams_mean: Predicted means

View source: R/tparams_mean.R

tparams_meanR Documentation

Predicted means

Description

Create a list containing means predicted from a statistical model.

Usage

tparams_mean(value, ...)

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.

Value

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

Note

The tparams_mean() constructor would not normally be used by users; instead, a tparams_mean object is typically created automatically as part of the StateVals class with create_StateVals().

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

# 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)

hesim-dev/hesim documentation built on Feb. 14, 2024, 1:18 a.m.