Re: [R] Regression trees with an ordinal response variable

2007-02-03 Thread Torsten Hothorn

On Fri, 2 Feb 2007, Henric Nilsson (Public) wrote:

 Torsten, consider the following:

 ### ordinal regression
 mammoct - ctree(ME ~ ., data = mammoexp)
 Warning message:
 no admissible split found
 ### estimated class probabilities
 treeresponse(mammoct, newdata = mammoexp[1:5, ])
 [[1]]
 [1] 1.822115

 [[2]]
 [1] 1.265487

 [[3]]
 [1] 1.822115

 [[4]]
 [1] 1.560440

 [[5]]
 [1] 1.822115


works again as advertised in party 0.9-9. Thanks for pointing this out!

Best wishes,

Torsten

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Regression trees with an ordinal response variable

2007-02-02 Thread Henric Nilsson (Public)
Den Fr, 2007-02-02, 06:03 skrev Stacey Buckelew:
 Hi,

 I am working on a regression tree in Rpart that uses a continuous response
 variable that is ordered.  I read a previous response by Pfr. Ripley to a
 inquiry regarding the ability of rpart to handle ordinal responses in
 2003.  At that time rpart was unable to implement an algorithm to handle
 ordinal responses.  Has there been any effort to rectify this in recent
 years?

The `ctree' function in the `party' package is able to handle ordered
responses, but note that there are fundamental differences between the
former and `rpart'. Reading the package vignette and the relevant
references will help.

However, at the moment there seems to be a problem related to the ordinal
case (predicted probabilities  1) and I've CC:ed the package's maintainer
(Torsten Hothorn).


HTH,
Henric

- - - - -

Torsten, consider the following:

 ### ordinal regression
 mammoct - ctree(ME ~ ., data = mammoexp)
Warning message:
no admissible split found
 ### estimated class probabilities
 treeresponse(mammoct, newdata = mammoexp[1:5, ])
[[1]]
[1] 1.822115

[[2]]
[1] 1.265487

[[3]]
[1] 1.822115

[[4]]
[1] 1.560440

[[5]]
[1] 1.822115

 sessionInfo()
R version 2.4.1 Patched (2007-01-06 r40399)
i386-pc-mingw32

locale:
LC_COLLATE=Swedish_Sweden.1252;LC_CTYPE=Swedish_Sweden.1252;LC_MONETARY=Swedish_Sweden.1252;LC_NUMERIC=C;LC_TIME=Swedish_Sweden.1252

attached base packages:
 [1] stats4grid  splines   stats graphics  grDevices
 [7] utils datasets  methods   base

other attached packages:
  party vcd  colorspaceMASS strucchangesandwich
0.9-8 1.0-2  0.957.2-31 1.3-1 2.0-1
zoocoin mvtnorm  modeltoolssurvival
1.2-2 0.5-2 0.7-50.2-10  2.30








 Thanks!

 Stacey



 On Mon, 2 Jun 2003, Andreas Christmann wrote:
  1. RE: Ordinal data - Regression Trees  Proportional Odds
 (Liaw, Andy)

  AFAIK there's no implementation (or description) of tree algorithm
  that handles ordinal response.
 

 Regression trees with an ordinal response variable can be computed with
 SPSS Answer Tree 3.0.
 They *can* be handled by tree or rpart in R.
 I think Andy's point was that there is no consensus as to the right way to
 handle them: certainly using the codes of categories works and may often
 be reasonable, and treating ordinal responses as categorical is also very
 often perfectly adequate.
 Note that rpart is user-extensible, so it would be reasonably easy to
 write
 an extension for a proportional-odds logistic regression model, if that is
 thought appropriate (and it seems strange to me to impose such strong
 structure on the model with such a general `linear predictor': POLR
 models are often in my experience a poor reflection of real problems).
 --
 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 272860 (secr)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __
 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
 and provide commented, minimal, self-contained, reproducible code.



__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Regression trees with an ordinal response variable

2007-02-02 Thread Torsten Hothorn

On Fri, 2 Feb 2007, Henric Nilsson (Public) wrote:

 Den Fr, 2007-02-02, 06:03 skrev Stacey Buckelew:
 Hi,

 I am working on a regression tree in Rpart that uses a continuous response
 variable that is ordered.  I read a previous response by Pfr. Ripley to a
 inquiry regarding the ability of rpart to handle ordinal responses in
 2003.  At that time rpart was unable to implement an algorithm to handle
 ordinal responses.  Has there been any effort to rectify this in recent
 years?

 The `ctree' function in the `party' package is able to handle ordered
 responses, but note that there are fundamental differences between the
 former and `rpart'. Reading the package vignette and the relevant
 references will help.


Hi Henric,

 However, at the moment there seems to be a problem related to the ordinal
 case (predicted probabilities  1) and I've CC:ed the package's maintainer
 (Torsten Hothorn).


yep, you are right (as always)-- a bug introduced by a fix, grrr. Its a 
little bit more complicated, but I'll make correct predictions available 
again *asap*.

Thanks!

Torsten


 HTH,
 Henric

 - - - - -

 Torsten, consider the following:

 ### ordinal regression
 mammoct - ctree(ME ~ ., data = mammoexp)
 Warning message:
 no admissible split found
 ### estimated class probabilities
 treeresponse(mammoct, newdata = mammoexp[1:5, ])
 [[1]]
 [1] 1.822115

 [[2]]
 [1] 1.265487

 [[3]]
 [1] 1.822115

 [[4]]
 [1] 1.560440

 [[5]]
 [1] 1.822115

 sessionInfo()
 R version 2.4.1 Patched (2007-01-06 r40399)
 i386-pc-mingw32

 locale:
 LC_COLLATE=Swedish_Sweden.1252;LC_CTYPE=Swedish_Sweden.1252;LC_MONETARY=Swedish_Sweden.1252;LC_NUMERIC=C;LC_TIME=Swedish_Sweden.1252

 attached base packages:
 [1] stats4grid  splines   stats graphics  grDevices
 [7] utils datasets  methods   base

 other attached packages:
  party vcd  colorspaceMASS strucchangesandwich
0.9-8 1.0-2  0.957.2-31 1.3-1 2.0-1
zoocoin mvtnorm  modeltoolssurvival
1.2-2 0.5-2 0.7-50.2-10  2.30








 Thanks!

 Stacey



 On Mon, 2 Jun 2003, Andreas Christmann wrote:
 1. RE: Ordinal data - Regression Trees  Proportional Odds
 (Liaw, Andy)

 AFAIK there's no implementation (or description) of tree algorithm
 that handles ordinal response.


 Regression trees with an ordinal response variable can be computed with
 SPSS Answer Tree 3.0.
 They *can* be handled by tree or rpart in R.
 I think Andy's point was that there is no consensus as to the right way to
 handle them: certainly using the codes of categories works and may often
 be reasonable, and treating ordinal responses as categorical is also very
 often perfectly adequate.
 Note that rpart is user-extensible, so it would be reasonably easy to
 write
 an extension for a proportional-odds logistic regression model, if that is
 thought appropriate (and it seems strange to me to impose such strong
 structure on the model with such a general `linear predictor': POLR
 models are often in my experience a poor reflection of real problems).
 --
 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 272860 (secr)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __
 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
 and provide commented, minimal, self-contained, reproducible code.





__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Regression trees with an ordinal response variable

2007-02-01 Thread Stacey Buckelew
Hi,

I am working on a regression tree in Rpart that uses a continuous response
variable that is ordered.  I read a previous response by Pfr. Ripley to a
inquiry regarding the ability of rpart to handle ordinal responses in
2003.  At that time rpart was unable to implement an algorithm to handle
ordinal responses.  Has there been any effort to rectify this in recent
years?

Thanks!

Stacey



On Mon, 2 Jun 2003, Andreas Christmann wrote:
  1. RE: Ordinal data - Regression Trees  Proportional Odds
 (Liaw, Andy)

  AFAIK there's no implementation (or description) of tree algorithm
  that handles ordinal response.
 

 Regression trees with an ordinal response variable can be computed with
 SPSS Answer Tree 3.0.
They *can* be handled by tree or rpart in R.
I think Andy's point was that there is no consensus as to the right way to
handle them: certainly using the codes of categories works and may often
be reasonable, and treating ordinal responses as categorical is also very
often perfectly adequate.
Note that rpart is user-extensible, so it would be reasonably easy to write
an extension for a proportional-odds logistic regression model, if that is
thought appropriate (and it seems strange to me to impose such strong
structure on the model with such a general `linear predictor': POLR
models are often in my experience a poor reflection of real problems).
-- 
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 272860 (secr)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
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
and provide commented, minimal, self-contained, reproducible code.