View source: R/experiment_utils.R
simple_tree_data | R Documentation |
Generates covariates and potential outcomes of a synthetic dataset for a simple tree model.
simple_tree_data(
A,
K = 5,
p = 10,
noise_std = 1,
split = 1.676,
signal_strength = 1,
noise_form = "normal"
)
A |
Integer. Number of observations in the dataset. Must be a positive integer. |
K |
Integer. Number of arms. Must be a positive integer. |
p |
Integer. Number of covariates. Must be a positive integer. |
noise_std |
Numeric. Standard deviation of the noise added to the potential outcomes. Must be a non-negative number. |
split |
Numeric. Split point for creating treatment groups based on the covariates. |
signal_strength |
Numeric. Strength of the signal in the potential outcomes. |
noise_form |
Character. Distribution of the noise added to the potential outcomes. Can be either "normal" or "uniform". |
A list containing the generated data (xs
, ys
, muxs
) and the true potential outcome means (mus
).
set.seed(123)
A <- 1000
K <- 4 # Number of treatment arms
p <- 10 # Number of covariates
synthetic_data <- simple_tree_data(A = A,
K = K,
p = p,
noise_std = 1.0,
split = 1.676,
signal_strength = 1.0,
noise_form = 'normal')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.