get_id_stage: Get IDs and Stages

View source: R/policy_data_functions.R

get_id_stageR Documentation

Get IDs and Stages

Description

get_id_stage returns the ID and stage number differnt types of events.

Usage

get_id_stage(object, event_set = c(0))

Arguments

object

Object of class policy_data or history.

event_set

Integer vector. Subset of c(0,1,2).

Value

data.table::data.table with keys id and stage.

Examples

### 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 IDs and stages:
head(get_id_stage(pd))

polle documentation built on Dec. 1, 2025, 5:08 p.m.