clls: Cumulative Link Location-Scale Models

View source: R/clls.R

clls-deprecatedR Documentation

Cumulative Link Location-Scale Models

Description

IMPORTANT: This function and its methods are no longer supported. The user is adviced to use clm() from package ordinal instead.

Fits a cumulative link location-scale model to an ordered response variable. When the scale part is left unspecified, the model reduces to a cumulative link model assuming a constant scale. With the default logistic link function, the model reduces to the famous Proportional Odds Model. With the probit link and a single two-level factor in both location and scale parts, the model is known as the Binormal model in the Signal Detection Theory and the Psychometric literature.

Usage

  clls(location, scale, data, weights, start, ..., subset,
           na.action, contrasts = NULL, Hess = FALSE, model = TRUE,
           method = c("logistic", "probit", "cloglog", "cauchit"))

Arguments

location

a formula expression as for regression models, of the form response ~ predictors. The response should be a factor (preferably an ordered factor), which will be interpreted as an ordinal response, with levels ordered as in the factor. The model must have an intercept: attempts to remove one will lead to a warning and be ignored. An offset may be used. See the documentation of formula for other details.

scale

a optional formula expression as for the location part, of the form ~ predictors, ie. with an empty left hand side. If left unspecified, the model assumes a constant scale and reduces to the cumulative link model. An offset may be used. See the documentation of formula for other details.

data

an optional data frame in which to interpret the variables occurring in formula.

weights

optional case weights in fitting. Default to 1.

start

initial values for the parameters. This is in the format c(beta, theta, sigma): see the Values section.

...

additional arguments to be passed to optim, most often a control argument.

subset

expression saying which subset of the rows of the data should be used in the fit. All observations are included by default.

na.action

a function to filter missing data.

contrasts

a list of contrasts to be used for some or all of the factors appearing as variables in the model formula.

Hess

logical for whether the Hessian (the observed information matrix) should be returned. Use this if you intend to call summary or vcov on the fit.

model

logical for whether the model matrix should be returned.

method

logistic or probit or complementary log-log or cauchit (corresponding to a Cauchy latent variable).

Details

The implementation is highly inspired by polr in package MASS and should give compatible results, if scale is left unspecified.

Note that standard errors are appropriate for tau = log sigma and not for sigma, because the profile likelihood is usually more symmetric for tau than for sigma. Therefore vcov will give the variance-covariance matrix of the parameters with tau rather than sigma and summary.clls will report standard errors for log sigma. Notice also that a relevant test for sigma is H_0: sigma = 1, so the relevant test for log sigma is H_0: log(sigma) = 0. This is reflected in the z value for sigma returned by summary.clls.

There are methods for the standard model-fitting functions, including summary, vcov, anova, and an extractAIC method.

Value

A object of class "clls". This has components

coefficients

the coefficients of the location (beta), the intercepts (theta) and the scale (sigma).

beta

the parameter estimates of the location part.

theta

the intercepts/thresholds for the class boundaries.

sigma

the parameter estimates of the scale part.

tau

parameter estimates of the scale part on the log scale; ie. tau = log sigma.

deviance

the residual deviance.

fitted.values

a matrix, with a column for each level of the response with the fitted probabilities.

fitted.case

a vector of same length as response, with the fitted probabilities on a case-by-case basis.

lev

the names of the response levels.

terms.location

a terms structure describing the location part.

terms.scale

a terms structure describing the scale part.

df.residual

the number of residual degrees of freedoms, calculated using the weights.

edf

the (effective) number of degrees of freedom used by the model

n, nobs

the (effective) number of observations, calculated using the weights.

call

the matched call.

method

the matched method used.

convergence

the convergence code returned by optim.

niter

the number of function and gradient evaluations used by optim.

Hessian

if Hess is true, the observed Fisher information matrix.

location

if model is true, the model.frame for the location part.

scale

if model is true, the model.frame for the scale part.

References

Agresti, A. (2002) Categorical Data. Second edition. Wiley.

Christensen, R.H.B., Cleaver, G. and Brockhoff, P.B. (2011). Statistical and Thurstonian models for the A-not A protocol with and without sureness. Food Quality and Preference, 22(6), pp.542-549.

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

polr, optim, glm, multinom.

Examples

  old <- options(contrasts = c("contr.treatment", "contr.poly"))
  ## Extend example from polr in package MASS:
  ## Fit model from polr example:
  data(housing, package = "MASS")
  fm1 <- clls(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
  fm1
  summary(fm1)
  ## With probit link:
  summary(update(fm1, method = "probit"))

  ## Allow scale to depend on Cont-variable
  summary(fm2 <- update(fm1, scale =~ Cont))
  anova(fm1, fm2)
  ## which seems to improve the fit
  options(old)


sensR documentation built on Nov. 2, 2023, 6:02 p.m.