condVar | R Documentation |
The ranef function extracts the conditional modes of the random effects from a clmm object. That is, the modes of the distributions for the random effects given the observed data and estimated model parameters. In a Bayesian language they are posterior modes.
The conditional variances are computed from the second order derivatives of the conditional distribution of the random effects. Note that these variances are computed at a fixed value of the model parameters and thus do not take the uncertainty of the latter into account.
condVar(object, ...)
## S3 method for class 'clmm'
ranef(object, condVar=FALSE, ...)
## S3 method for class 'clmm'
condVar(object, ...)
object |
a |
condVar |
an optional logical argument indicating of conditional variances should be added as attributes to the conditional modes. |
... |
currently not used by the |
The ranef
method returns a list of data.frame
s; one for
each distinct grouping factor. Each data.frame
has as many rows
as there are levels for that grouping factor and as many columns as
there are random effects for each level. For example a model can
contain a random intercept (one column) or a random
intercept and a random slope (two columns) for the same grouping
factor.
If conditional variances are requested, they are returned in the same structure as the conditional modes (random effect estimates/predictions).
The ranef
method returns a list of data.frame
s with the
random effects predictions/estimates computed as conditional
modes. If condVar = TRUE
a data.frame
with the
conditional variances is stored as an attribute on each
data.frame
with conditional modes.
The condVar
method returns a list of data.frame
s with
the conditional variances. It is a convenience function that simply
computes the conditional modes and variances, then extracts and
returns only the latter.
Rune Haubo B Christensen
fm1 <- clmm(rating ~ contact + temp + (1|judge), data=wine)
## Extract random effect estimates/conditional modes:
re <- ranef(fm1, condVar=TRUE)
## Get conditional variances:
attr(re$judge, "condVar")
## Alternatively:
condVar(fm1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.