View source: R/policy_data_functions.R
partial | R Documentation |
partial
creates a partial policy data object by trimming
the maximum number of stages in the policy data object to a fixed
given number.
partial(object, K)
object |
Object of class policy_data. |
K |
Maximum number of stages. |
Object of class policy_data.
library("polle")
### Multiple stage case
d <- sim_multi_stage(5e2, seed = 1)
# constructing policy_data object:
pd <- policy_data(data = d$stage_data,
baseline_data = d$baseline_data,
type = "long",
id = "id",
stage = "stage",
event = "event",
action = "A",
utility = "U")
pd
# Creating a partial policy data object with 3 stages
pd3 <- partial(pd, K = 3)
pd3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.