[R] Constraint on coefficient when fitting with lm, glm etc ...

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Dec 9 00:04:03 CET 2005


I've just answered a similar question from Richard O'Keefe.

MASS p.445 shows you how to do this for logistic regression, and the 
example is easy to modify.

On Thu, 8 Dec 2005, Devred, Emmanuel wrote:

> Dear R-users,
>
> I would like to know if there is any way to constraints optimized parameters
> using the function lm, glm or others that are written in the form:
> Lm( formula, data ...)
> As I understand, formula are of the type y ~ X1 +X2+ ... Xi (where Y, X1, X2
> ..Xi are vectors). In my case I would like the estimates of this linear
> combination computed with lm to be positives.
> I haven't found anything about it in the documentation, I would like to use
> the lm.ridge function with positives estimates.
> Would anyone have already met this problem ?
>
> Thank you,
>
>   Emmanuel
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595




More information about the R-help mailing list