Is there a function in R that classifies data in more than 2 groups using
logistic regression/classification? I want to compare the c-indices of
earlier research (lrm, binary response variables) with new c-indices
obtained from 'multiple' (more response variables) logistic regression.
Group of Geomatics Engineering
> Dear R-users,
> Is there a function in R that classifies data in more than 2 groups using
> logistic regression/classification? I want to compare the c-indices of
> earlier research (lrm, binary response variables) with new c-indices
> obtained from 'multiple' (more response variables) logistic regression.
> Best regards,
> Stephanie Delalieux
> Department Biosystems
> Group of Geomatics Engineering
> [hidden email]
There are many functions available but the answer depends on whether the
response variable has a natural ordering. Whether it does or not,
though, C-indexes may decrease from the binary case because predicting
more categories is a more difficult task.
In addition to the multinom(nnet) function mentioned below there is
some literature on how one can divide such polytomous problems into an
set of dichotomous classifications and then aggregate the results,
firstly gives an concise overview of the various above strategies and
compares their performance, arguing for the use of the method they
have themselves devised, i.e. ENDs, and secondly provides references
for articles describing the other methods in detail (e.g. Führnkranz).
The strategies mentioned above have the advantage that they do not
have a default class, in contrast to the multinom function.
Another question is whether any of these strategies have been
implemented in a publicly avaiblable library? At least my recent
cursory searches in the R-help archives and with help.search("...")
have not produced any tangible results. I've managed to concoct a set
of R-functions which crudely implement the strategies 1) one-vs-all
and 2) pairwise comparisons, which I attach below. They are probably
too much geared to my own research question and cut a few too many
corners to be used more generally without substantial modification,
and they could most probably be implemented in a more elegant manner,
but they might nevertheless be of some inspiration.
Having hacked these solutions on my own it would be all too typical
that some of the above multilevel classification strategies have in
fact already been in implemented in an available library. So, is
anyone on this list aware of such functions/libraries?
> > 13. Multiple logistic regression (Stephanie Delalieux)
> > Date: Wed, 8 Mar 2006 14:15:58 +0100
> > From: "Stephanie Delalieux" <[hidden email]>
> > Subject: [R] Multiple logistic regression
> > To: <[hidden email]>
> > Is there a function in R that classifies data in more than
> > 2 groups using logistic regression/classification? I want to
> > compare the c-indices of earlier research (lrm, binary response
> > variables) with new c-indices obtained from 'multiple' (more
> > response variables) logistic regression.
> Message: 23
> Date: Wed, 8 Mar 2006 22:26:24 +0800
> From: ronggui <[hidden email]>
> Subject: Re: [R] Multiple logistic regression
> To: "Stephanie Delalieux" <[hidden email]>
> Cc: [hidden email] >
> Do you mean multinomial logistic model?
> If it is,the multinom function in nnet package and multinomial
> function in VGAM(http://www.stat.auckland.ac.nz/~yee) package can do
1) dat: data (with the first column containing the multiclass variable
which is being predicted)
2) fn: predictor variables as a string, e.g. fn <- "A + B + C". In
this implementation, the predictor variables are assumed to be logical
(and thus binary); therefore, the GLM model family=binomial, and
should be changed if the data is of another sort.
3) lex: list with multiple classes being predicted, e.g.
lex <- c("a", "b", "c", "d")
4) freq: a Nx1 vector mapping frequency order of predicted classes to
their actual order in (3) lex, needed for the double-round method for
determining ties (-> alternative with the highest frequency selected)
5) teach.test.ratio: a list of length(2) indicating the proportions of
the data to be used for teaching the models and testing,
e.g. c(1,1) -> 50% teach vs. 50% testing, c(2,1) -> 66.6% vs. 33.3%
6) iter: number of iteration rounds in evaluating the accuracy of
7) classifier: either 'double.round.robin' or 'one.vs.all'