ranef.lmm | R Documentation |
Recover the random effects from the variance-covariance parameter of a linear mixed model.
## S3 method for class 'lmm'
ranef(
object,
effects = "mean",
ci = FALSE,
transform = (effects == "variance"),
p = NULL,
format = "long",
simplify = TRUE,
...
)
object |
a |
effects |
[character] should the estimated random effects ( |
ci |
[logical] should standard error and confidence intervals be evaluated using a delta method? Will slow down the execution of the function. |
transform |
[logical] should confidence intervals for the variance estimates (resp. relative variance estimates) be evaluated using a log-transform (resp. atanh transformation)? |
p |
[numeric vector] value of the model coefficients to be used. Only relevant if differs from the fitted values. |
format |
[character] should each type of random effect be output in a data.frame ( |
simplify |
[logical] when relevant will convert list with a single element to vectors and omit unessential output. |
... |
for internal use. |
Consider the following mixed model:
Y = X\beta + \epsilon = X\beta + Z\eta + \xi
where the variance of \epsilon
is denoted \Omega
,
the variance of \eta
is denoted \Omega_{\eta}
,
and the variance of \xi
is \sigma^2 I
with I
is the identity matrix.
The random effets are estimating according to:
E[Y|\eta] = \Omega_{\eta} Z^{t} \Omega^{-1} (Y-X\beta)
A data.frame or a list depending on the argument format
.
if(require(nlme)){
data(gastricbypassL, package = "LMMstar")
## random intercept
e.RI <- lmm(weight ~ time + (1|id), data = gastricbypassL)
ranef(e.RI, effects = "mean")
ranef(e.RI, effects = "variance")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.