View source: R/rating.emmeans.R
| rating.emmeans | R Documentation |
Extracts EMMeans (produced by emmeans) from Cumulative Link (Mixed) Models (produced by clm or clmm), with different possible formats.
rating.emmeans(emm, type = c("prob", "cumprob", "class1", "class2"), level = 0.9)
emm |
object returned by |
type |
type of output to be returned: |
level |
used only for type |
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.
Maxime HERVE <maxime.herve@univ-rennes1.fr>
emmeans, clm, clmm
if (require("ordinal",quietly=TRUE) & require("emmeans",quietly=TRUE)) {
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")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.