rating.emmeans: EMMeans for Cumulative Link (Mixed) Models

View source: R/rating.emmeans.R

rating.emmeansR Documentation

EMMeans for Cumulative Link (Mixed) Models

Description

Extracts EMMeans (produced by emmeans) from Cumulative Link (Mixed) Models (produced by clm or clmm), with different possible formats.

Usage

rating.emmeans(emm, type = c("prob", "cumprob", "class1", "class2"), level = 0.9)

Arguments

emm

object returned by emmeans applied on a clm or clmm object.

type

type of output to be returned: "prob" (default) gives probability of each rating, "cumprob" gives cumulative probabilities (Pi is probability to be <= to rating i), "class1" gives the most probable rating and "class2" gives the first rating for which the cumulative probability is >= to level.

level

used only for type "class2" (see type).

Details

A factor named cut must have been called in emmeans, to compute EMMeans per cut point (i.e. rating). Additionally, the argument mode of emmeans must have been set to "linear.predictor". Finally, the call to emmeans is typically like emmeans(model,~factor|cut,mode="linear.predictor") where factor is the factor (or interaction) giving levels for which EMMeans have to be computed.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

See Also

emmeans, clm, clmm

Examples

require(ordinal)
require(emmeans)

model <- clm(rating~contact*temp,data=wine)
EMM <- emmeans(model,~contact:temp|cut,mode="linear.predictor")

# Probabilities
rating.emmeans(EMM)

# Cumulative probabilities
rating.emmeans(EMM,type="cumprob")

# Most probable rating
rating.emmeans(EMM,type="class1")

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.