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.
ordsup(object, ...)
ordsup.vglm(object, all.vars = FALSE, confint = FALSE, ...)
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
.
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.
Logical. The default is to use explanatory variables
which are binary, but all variables are used (except the intercept)
if set to TRUE
.
Logical.
If TRUE
then confintvglm
is called to return confidence intervals for
method = "profile"
.
Parameters that can be fed into confintvglm
,
e.g., level = 0.95
and
method = c("wald", "profile")
.
Thomas W. Yee
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
Agresti, A. and Kateri, M. (2017). Ordinal probability effect measures for group comparisons in multinomial cumulative link models. Biometrics, 73, 214--219.
cumulative
,
propodds
,
uninormal
.
if (FALSE) {
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