tparams_mean | R Documentation |
Create a list containing means predicted from a statistical model.
tparams_mean(value, ...)
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
|
An object of class tparams_mean
, which is a list containing value
,
n_samples
, and the ID attributes passed to id_attributes.
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()
.
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()
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.