Learn R Programming

vcrpart (version 0.2-1)

olmm: Fitting ordinal two-stage linear mixed models

Description

Fits different types of two-stage linear mixed models for longitudinal (or clustered) ordinal (or multinomial) responses. O ne-stage models are also allowed. Random effects are assumed to be multivariate normal distributed with expectation 0. At the time being, cumulative link models with the logit, probit or cauchy link, the baseline-category logit and the adjacent-category logit model are implemented. Coefficients can be category-specific (i.e. non-proportional odds effects) or global (i.e. proportional odds, or parallel effects).

The function solves the score function for coefficients of the marginal likelihood by using Gauss-Hermite quadrature (e.g., Hedeker; 1994). Random effects are predicted by their expectation (see Hartzl et al.; 2001). Standard deviations of parameter estimates are, by default, based on the expected Fisher-information matrix.

Usage

cumulative(link = c("logit", "probit", "cauchy"))
adjacent(link = "logit")
baseline(link = "logit")

olmm(formula, data, family = cumulative(), weights, subset, na.action, offset, contrasts, control = olmm_control(), ...)

Arguments

formula
a symbolic description of the model. This should be something like y ~ ce(x1) + ge(x2) +re(1 + ge(w2) | id)

where ce(x1) specifies that the predictor x1 has a category-specific i.e. non-propor

data
an optional data frame with the variables in formula. By default the variables are taken from the environment from which olmm is called.
family
an family.olmm object produced by cumulative, adjacent or baseline.
weights
a numeric vector of weights with length equal the number of observations. The weights should be constant for subjects.
offset
a matrix specifying the offset separately for each predictor equation, of which there are the number of categories of the response minus one.
subset, na.action, contrasts
further model specification arguments as in lm.
control
a list of control parameters produced by olmm_control.
link
character string. The name of the link function.
...
arguments to be passed to control.

Value

  • olmm returns an object of class olmm. cumulative, adjacent and baseline yield an object of class family.olmm. The olmm class is a list containing the following components:
  • envenvironment in which the object was built.
  • framethe model frame.
  • callthe matched call to the function that created the object (class "call").
  • controla list of class olmm_control produced by olmm_control.
  • formulathe formula of the call.
  • termsa list of terms of the fitted model.
  • familyan object of class family.olmm that specifies that family of the fitted model.
  • y(ordered) categorical response vector.
  • Xmodel matrix for the fixed effects.
  • Wmodel matrix for the random effects.
  • subjecta factor vector with grouping levels.
  • subjectNamevariable name of the subject vector.
  • weightsnumeric observations weights vector.
  • weights_sbjnumeric weights vector of length N.
  • offsetnumeric offset matrix
  • xlevels(only where relevant) a list of levels of the factors used in fitting.
  • contrasts(only where relevant) a list of contrasts used.
  • dimsa named integer of dimensions. Some of the dimensions are $n$ is the number of observations, $p$ is the number of fixed effects per predictor and $q$ is the total number of random effects.
  • fixefa matrix of fixed effects (one column for each predictor).
  • ranefCholFaca lower triangular matrix. The cholesky decomposition of the covariance matrix of the random effects.
  • coefficientsa numeric vector of several fitted model parameters
  • restricteda logical vector indicating which elements of the coefficients slot are restricted to an initial value at the estimation.
  • etaa matrix of unconditional linear predictors of the fixed effects without random effects.
  • ua matrix of orthogonal standardized random effects (one row for each subject level).
  • logLik_obsa numeric vector of log likelihood value (one value for each observation).
  • logLik_sbja numeric vector of log likelihood values (one value for each subject level).
  • logLika numeric value. The log likelihood of the model.
  • score_obsa matrix of observation-wise partial derivates of the marginal log-likelihood equation.
  • score_sbja matrix of subject-wise partial derivates of the marginal log-likelihood equation.
  • scorea numeric vector of (total) partial derivates of the log-Likelihood function.
  • infothe information matrix (default is the expected information).
  • ghxa matrix of quadrature points for the Gauss-Hermite quadrature integration.
  • ghwa matrix of weights for the Gauss-Hermite quadrature integration.
  • ranefElMata transformation matrix
  • optima list of arguments for calling the optimizer function.
  • controla list of used control arguments produced by olmm_control.
  • outputthe output of the optimizer (class "list").

Details

The function can be used to fit simple ordinal two-stage mixed effect models with up to 3-4 random effects. For models with higher dimensions on random effects, the procedure may not convergence (cf. Tutz; 1996). Coefficients for the adjacent-category logit model are extracted via coefficient transformation (e.g. Agresti; 2010).

The three implemented families are defined as follows: cumulative is defined as the link of the sum of probabilities of lower categories, e.g., for link = "logit", the logit of the sum of probabilities of lower categories. adjacent is defined as the logit of the probability of the lower of two adjacent categories. baseline is defined as the logit of the probability of a category with reference to the highest category. Notice that the estimated coefficients of cumulative models may have the opposite sign those obtained with alternative software. For alternative fitting functions, see for example the functions clmm of ordinal, cumlogitRE of package glmmAK, nplmt of package mixcat, DPolmm of package DPpackage, lcmm of package lcmm, MCMCglmm of package MCMCglmm, sabre of package sabreR or OrdinalBoost of package GMMBoost.

The implementation adopts functions of the packages statmod (Novomestky, 2012) and matrixcalc (Smyth et al., 2014), which is not visible for the user. The authors are grateful for these codes.

References

Agresti, A. (2010). Analysis of Ordinal Categorical Data, 10 edn, Wiley. Hartzel, J., Agresti A. and Caffo, B. (2001). Multinomial Logit Random Effect Models, Statistical Modelling 1: 81--102 Hedeker, D. and Gibbons, R. (1994). A random-effects ordinal regression model for multilevel analysis, Biometrics 20 (4): 933--944

Tutz, G. and Hennevogl W. (1996). Random effects in ordinal regression models, Computational Statistics & Data Analysis 22 (5): 537--557

Tutz, G. (2012). Regression for Categorical Data, Cambridge Series in Statistical and Probabilistic Mathematics.

Frederick Novomestky (2012). matrixcalc: Collection of functions for matrix calculations. R package version 1.0-3. URL http://CRAN.R-project.org/package=matrixcalc

Gordon Smyth, Yifang Hu, Peter Dunn, Belinda Phipson and Yunshun Chen (2014). statmod: Statistical Modeling. R package version 1.4.20. URL http://CRAN.R-project.org/package=statmod

See Also

olmm-methods, olmm_control, ordered

Examples

Run this code
## ------------------------------------------------------------------- #
## Example 1: Schizophrenia
##
## Estimating the cumulative mixed models of
## Agresti (2010) chapters 10.3.1
## ------------------------------------------------------------------- #

data(schizo)

model.10.3.1 <-
  olmm(imps79o ~ tx + sqrt(week) + tx * sqrt(week) + re(1|id),
       data = schizo, family = cumulative())

summary(model.10.3.1)

## ------------------------------------------------------------------- #
## Example 2: Movie critics
##
## Estimating three of several adjacent-categories
## mixed models of Hartzl et. al. (2001)
## ------------------------------------------------------------------- #

data(movie)

## model with category-specific effects for "review"
model.24.1 <- olmm(critic ~  ce(review) + re(1|movie, intercept = "ce"),
                   data = movie, family = adjacent())

summary(model.24.1)

Run the code above in your browser using DataLab