Re: [R] Multiple logistic regression

2006-03-09 Thread Antti Arppe


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, 
e.g.:


1) one-vs-all
2) pairwise comparisons (aka [double] round-robin) (Führnkranz)
3) nested dichotomies
3) ensembles of nested dichotomies (aka ENDs) (Frank  Kramer)

The article by Eibe Frank  Stefan Kramer,

   Ensembles of nested dichotomies for multi-class problems
   http://wwwkramer.in.tum.de/kramer/frankkramer_icml04.pdf

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?


Regards,

-Antti Arppe

==
Antti Arppe - Master of Science (Engineering)
Researcher  doctoral student (Linguistics)
E-mail: [EMAIL PROTECTED]
WWW: http://www.ling.helsinki.fi/~aarppe


  13. Multiple logistic regression (Stephanie Delalieux)
 Date: Wed, 8 Mar 2006 14:15:58 +0100
 From: Stephanie Delalieux [EMAIL PROTECTED]
 Subject: [R] Multiple logistic regression
 To: r-help@stat.math.ethz.ch

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 [EMAIL PROTECTED]
Subject: Re: [R] Multiple logistic regression
To: Stephanie Delalieux [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch

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
it.


8-

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 
classication performance


7) classifier: either 'double.round.robin' or 'one.vs.all'

repeated.tests - 
function(dat,fn,lex,freq,teach.test.ratio=c(1,1),iter=1,hold.out=FALSE,classifier=double.round.robin,
 ...)
{ n.tot = nrow(dat);
  if(length(teach.test.ratio)==2)
n.teach=round(teach.test.ratio[1]*n.tot/sum(teach.test.ratio));
  n.test = n.tot - n.teach; nlex - length(lex);
  success - 
matrix(c(n.teach,round(n.teach*100/n.tot,2),n.test,round(n.test*100/n.tot,2),0,0,0),iter,7,byrow=TRUE);
  colnames(success) - c(Teach,%,Test,%,Success,%,tau (Kendall));
  test.lx - matrix(0,iter,nlex);
  colnames(test.lx) - lex;
  success.lx - guess.lx - test.lx;
  for(i in 1:iter)
 { selected - sample(seq(1:n.tot),n.teach,replace=hold.out);
   teach - dat[selected,];
   test - dat[-selected,];
   result - switch(classifier,
 double.round.robin = double.round.robin(teach,test,fn,lex,freq),
 one.vs.all = one.vs.all(teach,test,fn,lex));
   for(j in 1:n.test)
  { test.lx[i,pos(result[j,1],lex

Re: [R] Multiple logistic regression

2006-03-08 Thread ronggui
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
it.

But I have no idea about the c-index.

2006/3/8, Stephanie Delalieux [EMAIL PROTECTED]:
 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
 M³-BIORES
 Group of Geomatics Engineering
 [EMAIL PROTECTED]


 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



--
黄荣贵
Deparment of Sociology
Fudan University

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Multiple logistic regression

2006-03-08 Thread Frank E Harrell Jr
Stephanie Delalieux wrote:
 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
 M³-BIORES
 Group of Geomatics Engineering
 [EMAIL PROTECTED]

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.

Frank Harrell

 
 
 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] multiple logistic regression

2004-11-26 Thread Prof Brian Ripley
multinom() in package nnet.
On Fri, 26 Nov 2004, Anne Piotet wrote:
Is there an utility for multiple logistic regression where the response 
is not ordinal? As the predictors do not satisfy the necessary 
hypothesis, I cannot use discriminant analysis.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html