View source: R/policy_data_functions.R
get_utility | R Documentation |
get_utility()
returns the utility, i.e., the sum of the rewards,
for every observation in the policy data object.
get_utility(object)
object |
Object of class policy_data. |
data.table with key id and numeric variable U.
### Two stages:
d <- sim_two_stage(5e2, seed=1)
# constructing policy_data object:
pd <- policy_data(d,
action = c("A_1", "A_2"),
baseline = c("B"),
covariates = list(L = c("L_1", "L_2"),
C = c("C_1", "C_2")),
utility = c("U_1", "U_2", "U_3"))
pd
# getting the utility:
head(get_utility(pd))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.