View source: R/data_generators.R
| generate_binary_data | R Documentation |
Simulate binary outcome data
generate_binary_data(
n,
n_signal_parameters,
noise_parameters,
beta_signal,
complexity = 1,
nonlinear_strength = NULL,
predictor_type = "continuous",
binary_prevalence = 0,
correlation = 0.3,
distribution = "normal",
mu_lp = 0,
baseline_prob = 0.5
)
n |
Sample size. |
n_signal_parameters |
Number of signal predictors. These occupy the
first |
noise_parameters |
Number of noise predictors (zero coefficient). |
beta_signal |
Base effect size / overall scale of the signal. |
complexity |
Integer 1-4 specifying the functional form of the linear predictor:
|
nonlinear_strength |
Fraction of signal variance carried by the
nonlinear component (C2/C3 only), in [0, 1). When |
predictor_type |
Type of predictors: |
binary_prevalence |
Scalar in (0, 1]. Bernoulli probability applied to
all predictors when |
correlation |
Scalar in |
distribution |
Distribution family for all continuous
predictors. Default = |
mu_lp |
Intercept on the log-odds scale. Default = 0. |
baseline_prob |
Nominal baseline event probability (documentation only;
the realised probability is determined by |
A data frame with columns y (0/1), x1, x2, ...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.