clm.fit | R Documentation |
A direct fitter of cumulative link models.
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",
"Aranda-Ordaz", "log-gamma"),
threshold = c("flexible", "symmetric", "symmetric2", "equidistant"),
...)
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
|
start |
an optional list of starting values of the form
|
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
|
... |
currently not used. |
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.
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
.
Rune Haubo B Christensen
clm
## 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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.