Learn R Programming

VGAM (version 1.1-2)

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

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.

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 \(Y_1\) and \(Y_2\) be independent random variables from groups A and B, say, for a quantitative ordinal categorical scale. Then \(\Delta = P(Y_1 > Y_2) - P(Y_2 > Y_1)\) summarizes their relative size. A second quantity is \(\gamma = P(Y_1 > Y_2) - 0.5 \times P(Y_2 = Y_1)\). Then \(\Delta=2 \times \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.

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

cumulative, propodds, uninormal.

Examples

Run this code
# 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")
# }

Run the code above in your browser using DataLab