gen.binomial.data | R Documentation |
Simulate a data set with binary response following the logistic regression model.
gen.binomial.data(n, p, rho = 0, kappa = 5, beta.type = 1, seed = 2021)
n |
Sample size. |
p |
Number of covariates. |
rho |
The parameter defining the AR(1) correlation matrix. |
kappa |
The number of nonzero coefficients. |
beta.type |
Numeric indicator for choosing the beta type. For
|
seed |
The seed for reproducibility. Default is 2021. |
A list containing the simulated data.
X |
the covariate matrix, of dimension |
y |
the response, of length |
beta |
the true coefficients, of length |
bin_data <- gen.binomial.data(n = 200, p = 20, seed = 2021) head(bin_data$X) head(bin_data$y) head(bin_data$beta)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.