Description Usage Arguments Value Examples
View source: R/simulation-lib.R
Generate the X_i independently, but with each component of X_i
distributed Multivariate Normal with mean 0 and covariance matrix
with 1 on the diagonal and covar
on the off-diagonal. Exported
to the user.
1 | gen_xs_corr(n, p, covar = 0.5)
|
n |
Number of observations to generate |
p |
Number of dimensions for each observation (includes the intercept) |
covar |
Off-diagonal element of covariance matrix. |
An n * (p-1) matrix of generated covariates
1 2 3 4 5 6 7 8 9 | gen_xs_corr(10, 2)
gen_xs_corr(10, 2, 0.5)
set.seed(1)
# these should be equivalent
x1 <- gen_xs_corr(10, 2, 0)
set.seed(1)
x2 <- gen_xs_default(10, 2)
all(x1 == x2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.