Fits Cumulative Link Mixed Models with one or more random effects via the Laplace approximation or quadrature methods
clmm(formula, data, weights, start, subset, na.action, contrasts, Hess =
TRUE, model = TRUE, link = c("logit", "probit", "cloglog", "loglog",
"cauchit"), doFit = TRUE, control = list(), nAGQ = 1L,
threshold = c("flexible", "symmetric", "symmetric2", "equidistant"), ...)
a two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. The vertical bar character "|" separates an expression for a model matrix and a grouping factor.
an optional data frame in which to interpret the variables occurring in the formula.
optional case weights in fitting. Defaults to 1.
optional initial values for the parameters in the format
c(alpha, beta, tau)
, where alpha
are the threshold
parameters, beta
are the fixed regression parameters and
tau
are variance parameters for the random effects on the log
scale.
expression saying which subset of the rows of the data should be used in the fit. All observations are included by default.
a function to filter missing data.
a list of contrasts to be used for some or all of the factors appearing as variables in the model formula.
logical for whether the Hessian (the inverse of the observed
information matrix)
should be computed.
Use Hess = TRUE
if you intend to call summary
or
vcov
on the fit and Hess = FALSE
in all other instances
to save computing time.
logical for whether the model frames should be part of the returned object.
link function, i.e. the type of location-scale distribution
assumed for the latent distribution. The default "logit"
link
gives the proportional odds mixed model.
logical for whether the model should be fit or the model environment should be returned.
a call to clmm.control
integer; the number of quadrature points to use in the adaptive
Gauss-Hermite quadrature approximation to the likelihood
function. The default (1
) gives the Laplace
approximation. Higher values generally provide higher precision at
the expense of longer computation times, and
values between 5 and 10 generally provide accurate maximum
likelihood estimates. Negative values give the non-adaptive
Gauss-Hermite quadrature approximation, which is generally faster
but less
accurate than the adaptive version. See the references for further
details. Quadrature methods are only available with a single random
effects term; the Laplace approximation is always available.
specifies a potential structure for the thresholds
(cut-points). "flexible"
provides the standard unstructured
thresholds, "symmetric"
restricts the distance between the
thresholds to be symmetric around the central one or two thresholds
for odd or equal numbers or thresholds respectively,
"symmetric2"
restricts the latent
mean in the reference group to zero; this means that the central
threshold (even no. response levels) is zero or that the two central
thresholds are equal apart from their sign (uneven no. response
levels), and
"equidistant"
restricts the distance between consecutive
thresholds to be of the same size.
additional arguments are passed on to clm.control
.
a list containing
threshold parameters.
fixed effect regression parameters.
standard deviation of the random effect terms.
log(stDev)
- the scale at which the log-likelihood
function is optimized.
the estimated model parameters = c(alpha,
beta, tau)
.
List of control parameters as generated by clm.control
.
Hessian of the model coefficients.
the estimated degrees of freedom used by the model =
length(coefficients)
.
sum(weights)
.
length(y).
fitted values evaluated with the random effects at their conditional modes.
residual degrees of freedom; length(y) -
sum(weights)
Jacobian of the threshold function corresponding to the mapping from standard flexible thresholds to those used in the model.
the terms object for the fixed effects.
contrasts applied to the fixed model terms.
the function used to filter missing data.
the matched call.
value of the log-likelihood function for the model at the optimum.
number of Newton iterations in the inner loop update of the conditional modes of the random effects.
list of results from the optimizer.
list of the conditional modes of the random effects.
list of the conditional variance of the random effects at their conditional modes.
This is a new (as of August 2011) improved implementation of CLMMs. The
old implementation is available in clmm2
. Some features
are not yet available in clmm
; for instance
scale effects, nominal effects and flexible link functions are
currently only available in clmm2
. clmm
is expected to
take over clmm2
at some point.
There are standard print, summary and anova methods implemented for
"clmm"
objects.
# NOT RUN {
## Cumulative link model with one random term:
fmm1 <- clmm(rating ~ temp + contact + (1|judge), data = wine)
summary(fmm1)
# }
# NOT RUN {
## May take a couple of seconds to run this.
## Cumulative link mixed model with two random terms:
mm1 <- clmm(SURENESS ~ PROD + (1|RESP) + (1|RESP:PROD), data = soup,
link = "probit", threshold = "equidistant")
mm1
summary(mm1)
## test random effect:
mm2 <- clmm(SURENESS ~ PROD + (1|RESP), data = soup,
link = "probit", threshold = "equidistant")
anova(mm1, mm2)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab