This function generates simulated data including the predictor matrix `X` and the response vector `y`,
based on the specified parameters. The function allows for the simulation of data under different settings
of correlation, distribution, and the number of observations and subjects.
A list containing two elements: `X`, the matrix of predictors, and `y`, the response vector.
Arguments
nsub
Integer, the number of subjects.
nobs
Integer or numeric vector, the number of observations per subject.
p
Integer, the number of predictors.
beta0
Numeric vector, initial coefficients for the first few predictors.
rho
Numeric, the correlation coefficient used in generating correlated errors.
corstr
Character, specifies the correlation of correlation structure for the covariance matrix.
Options are "cs" or "exchangeable" for compound symmetry, "AR1" for autoregressive, and any other input
will result in an identity matrix.
dis
Character, the distribution of errors ("normal" or "t").
ka
1 for heterogeneous errors and 0 for homogeneous errors.
SNPs
User can provide simulated or real SNPs for genetic data simulation.