Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ordsup

Ordinal Superiority Measures


Description

Ordinal superiority measures for the linear model and cumulative link models: the probability that an observation from one distribution falls above an independent observation from the other distribution, adjusted for explanatory variables in a model.

Usage

ordsup(object, ...)
ordsup.vglm(object, all.vars = FALSE, confint = FALSE, ...)

Arguments

object

A vglm fit. Currently it must be one of: cumulative, uninormal. The links for cumulative must be logitlink or probitlink, and parallel = TRUE is also needed. For uninormal the mean must use identitylink and model the sd as intercept-only.

all.vars

Logical. The default is to use explanatory variables which are binary, but all variables are used (except the intercept) if set to TRUE.

confint

Logical. If TRUE then confintvglm is called to return confidence intervals for gamma and Delta. By default, Wald intervals are produced, but they can be replaced by profile intervals by setting method = "profile".

...

Parameters that can be fed into confintvglm, e.g., level = 0.95 and method = c("wald", "profile").

Details

Details are given in Agresti and Kateri (2017) and this help file draws directly from this. This function returns two quantities for comparing two groups on an ordinal categorical response variable, while adjusting for other explanatory variables. They are called “ordinal superiority” measures, and the two groups can be compared without supplementary explanatory variables. Let Y1 and Y2 be independent random variables from groups A and B, say, for a quantitative ordinal categorical scale. Then Delta = P(Y1 > Y2) - P(Y2 > Y1) summarizes their relative size. A second quantity is gamma = P(Y1 > Y2) - 0.5 * P(Y2 = Y1). Then Delta=2 * gamma -1. whereas gamma=(Delta + 1)/2. The range of gamma is [0, 1], while the range of Delta is [-1, 1]. The examples below are based on that paper. This function is currently implemented for a very limited number of specific models.

Value

By default, a list with components gamma and Delta, where each is a vector with elements corresponding to binary explanatory variables (i.e., 0 or 1), and if no explanatory variables are binary then a NULL is returned. If confint = TRUE then the list contains 4 more components: lower.gamma, upper.gamma, Lower.Delta, Upper.Delta.

Author(s)

Thomas W. Yee

References

Agresti, A. and Kateri, M. (2017). Ordinal probability effect measures for group comparisons in multinomial cumulative link models. Biometrics, 73, 214–219.

See Also

Examples

## Not run: 
Mental <- read.table("http://www.stat.ufl.edu/~aa/glm/data/Mental.dat",
                     header = TRUE)  # Make take a while to load in
Mental$impair <- ordered(Mental$impair)
pfit3 <- vglm(impair ~ ses + life, data = Mental,
         cumulative(link = "probitlink", reverse = FALSE, parallel = TRUE))
coef(pfit3, matrix = TRUE)
ordsup(pfit3)  # The 'ses' variable is binary

# Fit a crude LM
fit7 <- vglm(as.numeric(impair) ~ ses + life, uninormal, data = Mental)
coef(fit7, matrix = TRUE)  # 'sd' is estimated by MLE
ordsup(fit7)
ordsup(fit7, all.vars = TRUE)  # Some output may not be meaningful
ordsup(fit7, confint = TRUE, method = "profile")

## End(Not run)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.