clm.fit: Fit Cumulative Link Models

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/clm.fit.R

Description

A direct fitter of cumulative link models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
clm.fit(y, ...)

## Default S3 method:
clm.fit(y, ...)

## S3 method for class 'factor'
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, doFit=TRUE,
     link = c("logit", "probit", "cloglog", "loglog", "cauchit"),
     threshold = c("flexible", "symmetric", "symmetric2", "equidistant"),
     ...)

Arguments

y

for the default method a list of model components. For the factor method 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).

doFit

logical for whether the model should be fit or the model environment should be returned.

link

the link function.

threshold

the threshold structure, see further at clm.

...

currently not used.

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.

clm.fit.factor is not able to check if all thresholds are increasing when nominal effects are specified since it needs access to the terms object for the nominal model. If the terms object for the nominal model (nom.terms) is included in y, the default method is able to chech if all thresholds are increasing.

Value

A list with the following components: aliased, alpha, coefficients, cond.H, convergence, df.residual, edf, fitted.values, gradient, Hessian, logLik, maxGradient, message, n, niter, nobs, tJac, vcov and optionally beta, zeta These components are documented in clm.

Author(s)

Rune Haubo B Christensen

See Also

clm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## A simple example:
fm1 <- clm(rating ~ contact + temp, data=wine)
summary(fm1)
## get the model frame containing y and X:
mf1 <- update(fm1, method="design")
names(mf1)
res <- clm.fit(mf1$y, mf1$X) ## invoking the factor method
stopifnot(all.equal(coef(res), coef(fm1)))
names(res)

## Fitting with the default method:
mf1$control$method <- "Newton"
res2 <- clm.fit(mf1)
stopifnot(all.equal(coef(res2), coef(fm1)))

ordinal documentation built on May 2, 2019, 5:47 p.m.