sim_two_stage {polle} | R Documentation |
Simulate Two-Stage Data
Description
Simulate Two-Stage Data
Usage
sim_two_stage(
n = 10000,
par = c(gamma = 0.5, beta = 1),
seed = NULL,
action_model_1 = function(C_1, beta, ...) stats::rbinom(n = NROW(C_1), size = 1, prob =
lava::expit(beta * C_1)),
action_model_2 = function(C_2, beta, ...) stats::rbinom(n = NROW(C_1), size = 1, prob =
lava::expit(beta * C_2)),
deterministic_rewards = FALSE
)
Arguments
n |
Number of observations. |
par |
Named vector with distributional parameters.
|
seed |
Integer. |
action_model_1 |
Function used to specify the action/treatment at stage 1. |
action_model_2 |
Function used to specify the action/treatment at stage 2. |
deterministic_rewards |
Logical. If TRUE, the deterministic reward contributions are returned as well (columns U_1_A0, U_1_A1, U_2_A0, U_2_A1). |
Details
sim_two_stage
samples n
iid observation
with the following distribution:
is a random categorical variable with levels
group1
,
group2
, and group3
. Furthermore,
The rewards are calculated as
Value
data.table with n rows and columns B, BB, L_1, C_1, A_1, L_2, C_2, A_2, L_3, U_1, U_2, U_3 (,U_1_A0, U_1_A1, U_2_A0, U_2_A1).
[Package polle version 1.4 Index]