Learn R Programming

RVAideMemoire (version 0.9-45-2)

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

Description

Extracts 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.
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).

Details

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

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,mode="linear.predictor")

# 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