Skip to contents

Cumulative link mixed models (CLMM) for ordinal response data with random effects. Appropriate for Likert-scale data, ordered categorical outcomes (e.g., tumor grades, disease severity), and repeated-measures designs with ordinal endpoints. Uses the ordinal package for fitting cumulative link mixed models with logit, probit, or complementary log-log links.

Usage

ordinalmixedmodel(
  data,
  dep,
  fixedFactors = NULL,
  fixedCovs = NULL,
  randomTerms,
  link = "logit",
  threshold = "flexible",
  propOddsTest = TRUE,
  oddsRatios = TRUE,
  confInt = TRUE,
  confLevel = 0.95,
  randomEffectsTable = TRUE,
  thresholdsTable = TRUE,
  modelFit = TRUE,
  conditionMeans = FALSE
)

Arguments

data

the data as a data frame

dep

Ordinal dependent variable (e.g., Likert scale, tumor grade, severity level)

fixedFactors

Categorical fixed-effect predictors

fixedCovs

Continuous fixed-effect predictors

randomTerms

Random effects grouping variables (e.g., subject ID, rater, site)

Link function for the cumulative model

threshold

Threshold parameterization

propOddsTest

Test the proportional odds (parallel lines) assumption using nominal_test

oddsRatios

Display exponentiated coefficients as odds ratios

confInt

Show confidence intervals for coefficients

confLevel

Confidence level for intervals

randomEffectsTable

Show random effects variance components

thresholdsTable

Show threshold (intercept) coefficients

modelFit

Show AIC, BIC, log-likelihood, and deviance

conditionMeans

Show predicted marginal probabilities for each factor level

Value

A results object containing:

results$instructionsa html
results$modelFitTablea table
results$fixedEffectsa table
results$thresholdsa table
results$randomEffectsa table
results$propOddsTestTablea table
results$conditionProbsa table
results$methodExplanationa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$modelFitTable$asDF

as.data.frame(results$modelFitTable)

Examples

# \donttest{
data |>
ordinalmixedmodel(
    dep = "rating",
    fixedFactors = "scanner",
    randomTerms = "pathologist"
)
#> Error: Argument 'data' must be a data frame
# }