[R] Re: [S] Regressions with monotonicity constraints

Greg Snow snow at fisher.byu.edu
Sat Mar 17 00:24:06 CET 2001


On Mon, 12 Mar 2001, Vadim Ogranovich wrote:

> This seems to be a recurrent topic, but I don't remember hearing a
> definitive answer. I also apologies for cross-posting.
> 
> Say I have a numerical response variable and a bunch of multi-level factors
> I want to use for modeling. I don't expect factor interaction to be
> important so there will be no interactions in the model.
> All this would be a perfect job for ANOVA except for one additional
> requirement: all factors are ordered, i.e. for any two levels in a factor
> one is bigger than the other, and I want the regression to preserve the
> ordering, that is to be monotonic.
> 

The answers that Thomas gave are probably more theoretically sound than
the below, but from a simple computational standpoint here are a couple of
ideas:

ACE and AVAS both allow monotone constraints, just constrain y to be
linear and replace your odered factors with integers (codes) and constrain
them to be monotone in the call to ace or avas, you'll need to take the
output and do a final regression on it and change the degrees of freedom,
but it should be a decent exploratory tool.

A second option would be to specify a contrasts matrix that is lower
triangular, i.e. for 4 levels:

     [,1] [,2] [,3] 
[1,]    0    0    0
[2,]    1    0    0
[3,]    1    1    0
[4,]    1    1    1

then each beta is the measure of the difference in 2 levels.  The S-PLUS
function nnls.fit will fit the linear regression constraining all
parameter estimates to be non-negative which will give you monotone
increasing in your ordered factors (though possibly with adjacent levels
equal).  A contrast matrix like:

     [,1] [,2] [,3] 
[1,]    0    0    0
[2,]    1    0    0
[3,]    2    1    0
[4,]    3    2    1

would also work (using nnls.fit again), but this time it says that the
increase from one level to the next, must be greater than or equal to the
previous increase (positive second derivative). 


hope this helps,

-- 
Greg Snow, PhD                Office: 223A TMCB
Department of Statistics      Phone:  (801) 378-7049
Brigham Young University      Dept.:  (801) 378-4505
Provo, UT  84602              email:  gls at byu.edu

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list