LSMeans for Cumulative Link (Mixed) Models

Share:

Description

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

Usage

1
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 "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 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.

Author(s)

Maxime Herv<e9> <mx.herve@gmail.com>

See Also

lsmeans, clm, clmm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.