clm.fit {ordinal}R Documentation

Fit Cumulative Link Models

Description

A direct fitter of cumulative link models.

Usage


clm.fit(y, X, S, N, weights = rep(1, nrow(X)),
  offset = rep(0, nrow(X)), S.offset = rep(0, nrow(X)),
  control = list(), start,
  link = c("logit", "probit", "cloglog", "loglog", "cauchit"),
  threshold = c("flexible", "symmetric", "symmetric2", "equidistant"))

Arguments

y

the response variable; a factor, preferably and ordered factor.

X, S, N

optional design matrices for the regression parameters, scale parameters and nominal parameters respectively.

weights

optional case weights.

offset

an optional offset.

S.offset

an optional offset for the scale part of the model.

control

a list of control parameters, optionally a call to clm.control.

start

an optional list of starting values of the form c(alpha, beta, zeta) for the thresholds and nominal effects (alpha), regression parameters (beta) and scale parameters (zeta).

link

the link function.

threshold

the threshold structure, see further at clm.

Details

This function does almost the same thing that clm does: it fits a cumulative link model. The main differences are that clm.fit does not setup design matrices from formulae and only does minimal post processing after parameter estimation.

Compared to clm, clm.fit does little to warn the user of any problems with data or model. However, clm.fit will attempt to identify column rank defecient designs. Any unidentified parameters are indicated in the aliased component of the fit.

In contrast to clm, clm.fit allows non-positive weights.

Value

A list with the following components:

par

the maximum likelihood estimate of the model parameters on the form c(alpha, beta, zeta) for the thresholds and nominal effects (alpha), regression parameters (beta) and scale parameters (zeta).

gradient

gradient of the log-likelihood function for the parameters at the optimum.

Hessian

the Hessian of the parameters at the optimum.

logLik

the value of the log-likelihood function at the optimum.

convergence

a convergence code; 1: successful convergence, 2: iteration limit reached, 3: step factor reduced below minimum.

message

convergence message.

maxGradient

the maximum absolute gradient: max(abs(gradient)).

niter

depends on the optimizer. For the default Newton optimizer it is a vector of length 2: the number of iteration and the number of step halvings respectively.

fitted

the fitted values (probabilities).

coef.names

a list of vectors of names of the coefficients as inferred from the column names of the design matrices.

aliased

a list of logical vectors; TRUE is a parameter is not identified due to column rank deficiency in the design matrices and FALSE otherwise.

Author(s)

Rune Haubo B Christensen

See Also

clm

Examples


## A simple example:
fm1 <- clm(rating ~ contact + temp, data=wine)
summary(fm1)
## get the model frame containing y and X:
mf1 <- update(fm1, method="model.frame")
clm.fit(mf1$y, mf1$X)


[Package ordinal version 2013.9-30 Index]