lmm.simu | R Documentation |
Simulate data under a linear mixed model, using the eigen decomposition of the variance matrix.
lmm.simu(tau, sigma2, K, eigenK = eigen(K), X, beta)
tau |
Model parameter |
sigma2 |
Model parameter |
K |
(Optional) A positive symmetric matrix |
eigenK |
Eigen decomposition of |
X |
Covariable matrix |
beta |
Fixed effect vector of covariables |
The data are simulated under the following linear mixed model :
Y = X\beta + \omega + \varepsilon
with \omega \sim N(0,\tau K)
and
\varepsilon \sim N(0,\sigma^2 I_n)
.
The simulation uses K
only through its eigen decomposition; the parameter
K
is therefore optional.
A named list with two members:
y |
Simulated value of |
omega |
Simulated value of |
Hervé Perdry and Claire Dandine-Roulland
random.pm
# generate a random positive matrix
set.seed(1)
R <- random.pm(503)
# simulate data with a "polygenic component"
y <- lmm.simu(0.3, 1, eigenK = R$eigen)
str(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.