generate_cre_dataset {CRE}R Documentation

Generate CRE synthetic data

Description

Generates synthetic data with continues or binary outcome.

Usage

generate_cre_dataset(
  n = 1000,
  rho = 0,
  n_rules = 2,
  p = 10,
  effect_size = 2,
  binary_covariates = TRUE,
  binary_outcome = TRUE,
  confounding = "no"
)

Arguments

n

An integer number that represents the number of observations. Non-integer values will be converted into an integer number.

rho

A positive double number that represents the correlation within the covariates (default: 0, range: (0,1)).

n_rules

The number of causal rules. (default: 2, range: 1,2,3,4).

p

The number of covariates (default: 10).

effect_size

The effect size magnitude in (default: 2, range: >=0).

binary_covariates

Whether to use binary or continuous covariates (default: TRUE).

binary_outcome

Whether to use binary or continuous outcomes (default: TRUE).

confounding

Only for continuous outcome, add confounding variables:

  • Linear confounding "lin".

  • Non-linear confounding "nonlin".

  • No confounding "no" (default).

Value

A list of synthetic data containing:

Note

Set (binary/continuous) covariates domain (binary_covariates). Set (binary/continuous) outcome domain (binary_outcome). Increase complexity in heterogeneity discovery:

Examples

set.seed(123)
dataset <- generate_cre_dataset(n = 1000, rho = 0, n_rules = 2, p = 10,
                                effect_size = 2, binary_covariates = TRUE,
                                binary_outcome = TRUE, confounding = "no")


[Package CRE version 0.2.0 Index]