Learn R Programming

RVAideMemoire (version 0.9-35)

rating.lsmeans: LSMeans for Cumulative Link (Mixed) Models

Description

Extract LSMeans (produced by lsmeans) from Cumulative Link (Mixed) Models (produced by clm or clmm), with different possible formats.

Usage

rating.lsmeans(lsm, type = c("prob", "cumprob", "class1", "class2"), level = 0.9)

Arguments

lsm
object returned by lsmeans applied on a clm or clmm object. A factor named cut mu
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 "
level
used only for type "class2" (see type).

See Also

lsmeans, clm, clmm

Examples

Run this code
require(ordinal)
require(lsmeans)

model <- clm(rating~contact*temp,data=wine)
LSM <- lsmeans(model,~contact:temp|cut)

# Probabilities
rating.lsmeans(LSM)

# Cumulative probabilities
rating.lsmeans(LSM,type="cumprob")

# Most probable rating
rating.lsmeans(LSM,type="class1")

Run the code above in your browser using DataLab