generate_X.Rd
This function simulates Gaussian predictors with mean zero and a covariance structure determined by the "cov_type" argument. Then, `p_b` randomly selected columns are dichotomized.
generate_X(n, p, p_b = 0, cov_type = "cov_ar1", rho = 0.5)
Number of observations (rows of X).
Total number of covariates (columns of X), both continuous and binary.
Number of binary covariates (0 <= p_b <= p).
Character string specifying the covariance function: - "cov_diag" (independent columns). - "cov_equi" (equi-correlated columns). - "cov_ar1" (AR(1)-correlated columns).
Correlation parameter; input to the cov_type function.
A simulated data frame with `n` rows and `p` columns, of which `p_b` are binary and `p - p_b` are Gaussian. Each column is either of class "numeric" or "factor".
This function simulates a data frame whose rows are multivariate Gaussian with mean zero and covariance structure determined by the "cov_type" argument. Then, `p_b` randomly selected columns are dichotomized with the function \(1(x > 0)\). The continuous columns are of class "numeric", and the binary columns are set to class "factor".
Other generate:
generate_Weib()
,
generate_lp()
,
generate_y()
# All columns are continuous:
X <- generate_X(n=80, p=100, p_b=0, cov_type="cov_equi", rho=0.5)
# Two of the columns are dichotomized (and set to class factor):
X <- generate_X(n=80, p=100, p_b=2, cov_type="cov_equi", rho=0.5)