View source: R/family.categorical.R
sratio | R Documentation |
Fits a stopping ratio logit/probit/cloglog/cauchit/... regression model to an ordered (preferably) factor response.
sratio(link = "logitlink", parallel = FALSE, reverse = FALSE,
zero = NULL, ynames = FALSE, Thresh = NULL, Trev = reverse,
Tref = if (Trev) "M" else 1, whitespace = FALSE)
link |
Link function applied to the |
parallel |
A logical, or formula specifying which terms have equal/unequal coefficients. |
reverse |
Logical.
By default, the stopping ratios used are
|
ynames |
See |
zero |
Can be an integer-valued vector specifying which
linear/additive predictors are modelled as intercepts only.
The values must be from the set {1,2,..., |
Thresh , Trev , Tref |
See |
whitespace |
See |
In this help file the response Y
is assumed to be a factor
with ordered values 1,2,\dots,M+1
, so that
M
is the number of linear/additive predictors
\eta_j
.
There are a number of definitions for the continuation ratio
in the literature. To make life easier, in the VGAM package,
we use continuation ratios (see cratio
)
and stopping ratios.
Continuation ratios deal with quantities such as
logitlink(P[Y>j|Y>=j])
.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions
such as vglm
,
rrvglm
and vgam
.
No check is made to verify that the response is ordinal if the
response is a matrix;
see ordered
.
Boersch-Supan (2021) considers a sparse data set
(called budworm
)
and the numerical problems encountered when
fitting models such as
cratio
,
sratio
,
cumulative
.
Although improvements to links such as
clogloglink
have been made,
currently these family functions have not been
properly adapted to handle sparse data as well as they could.
The response should be either a matrix of counts
(with row sums that
are all positive), or a factor. In both cases,
the y
slot
returned by vglm
/vgam
/rrvglm
is the matrix
of counts.
For a nominal (unordered) factor response, the multinomial
logit model (multinomial
) is more appropriate.
Here is an example of the usage of the parallel
argument.
If there are covariates x1
, x2
and x3
, then
parallel = TRUE ~ x1 + x2 -1
and
parallel = FALSE ~ x3
are equivalent. This would constrain
the regression coefficients for x1
and x2
to be
equal; those of the intercepts and x3
would be different.
Thomas W. Yee
Agresti, A. (2013). Categorical Data Analysis, 3rd ed. Hoboken, NJ, USA: Wiley.
Boersch-Supan, P. H. (2021). Modeling insect phenology using ordinal regression and continuation ratio models. ReScience C, 7.1, 1–14. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v032.i10")}.
McCullagh, P. and Nelder, J. A. (1989). Generalized Linear Models, 2nd ed. London: Chapman & Hall.
Tutz, G. (2012). Regression for Categorical Data, Cambridge: Cambridge University Press.
Yee, T. W. (2010). The VGAM package for categorical data analysis. Journal of Statistical Software, 32, 1–34. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v032.i10")}.
cratio
,
acat
,
cumulative
,
multinomial
,
CM.equid
,
CommonVGAMffArguments
,
margeff
,
pneumo
,
budworm
,
logitlink
,
probitlink
,
clogloglink
,
cauchitlink
.
pneumo <- transform(pneumo, let = log(exposure.time))
(fit <- vglm(cbind(normal, mild, severe) ~ let,
sratio(parallel = TRUE), data = pneumo))
coef(fit, matrix = TRUE)
constraints(fit)
predict(fit)
predict(fit, untransform = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.