fitLMM | R Documentation |
Fit a linear mixed model of the form y = Xb + e where e follows a
multivariate normal distribution with mean 0 and variance matrix
sigmasq_g K + sigmasq_e I
, where K
is a known kniship
matrix and I
is the identity matrix.
fitLMM(Kva, y, X, reml = TRUE, check_boundary = TRUE, tol = 0.0001,
use_cpp = TRUE, compute_se = FALSE)
Kva |
Eigenvalues of K (calculated by |
y |
Rotated phenotypes (calculated by |
X |
Rotated covariate matrix (calculated by |
reml |
If TRUE, use REML; otherwise use ordinary maximum likelihood. |
check_boundary |
If TRUE, explicitly check log likelihood at 0 and 1. |
tol |
Tolerance for convergence |
use_cpp |
= if TRUE, use c++ version of code |
compute_se |
= if TRUE, return the standard error of the |
List containing estimates of beta
, sigmasq
,
hsq
, sigmasq_g
, and sigmasq_e
, as well as the log
likelihood (loglik
). If compute_se=TRUE
, the output also
contains hsq_se
.
data(recla)
e <- eigen_rotation(recla$kinship, recla$pheno[,1], recla$covar)
result <- fitLMM(e$Kva, e$y, e$X)
# also compute SE
wSE <- fitLMM(e$Kva, e$y, e$X, compute_se = TRUE, use_cpp=FALSE)
c(hsq=wSE$hsq, SE=wSE$hsq_se)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.