View source: R/policy_eval_functions.R
conditional | R Documentation |
conditional()
is used to calculate the
policy value for each group defined by a given baseline variable.
conditional(object, policy_data, baseline)
object |
Policy evaluation object created by |
policy_data |
Policy data object created by |
baseline |
Character string. |
object of inherited class 'estimate', see lava::estimate.default. The object is a list with elements 'coef' (policy value estimate for each group) and 'IC' (influence curve estimate matrix).
library("polle")
library("data.table")
setDTthreads(1)
d <- sim_single_stage(n=2e3)
pd <- policy_data(d,
action = "A",
baseline = c("B"),
covariates = c("Z","L"),
utility = "U")
# static policy:
p <- policy_def(1)
pe <- policy_eval(pd,
policy = p)
# conditional value for each group defined by B
conditional(pe, pd, "B")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.