[R] Constraining Predicted Values to be Greater Than 0

Wensui Liu liuwensui at gmail.com
Wed Sep 26 18:38:14 CEST 2007


if your regression under gaussian assumption, then you can't
constraint your predicted to be positive.
I don't know much about your dep in the model. but given more
appropriate distribution assumption, the constraint is doable. One
possibility that I can think of is poisson.

On 9/25/07, Westley Ritz <writz at trchome.com> wrote:
> I have a WLS regression with 1 dependent variable and 3 independent variables.  I wish to constrain the predicted values (the fitted values) so that they are greater than zero (i.e. they are positive).  I do not know how to impose this constraint in R.  Please respond if you have any suggestions.
>
> There are some previous postings about constraining the coefficients, but this won't accomplish what I am trying to do.  The coefficients can be negative, just as long as the predicted values are positive.
>
> Thank you in advance for your time.
>
> Westley A. Ritz
> Analyst
> 215-641-2243
> writz at trchome.com
>
> TRC
> www.trchome.com
>
> ______________________________________________
> R-help at r-project.org 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.
>
>


-- 
===============================
"I am dying with the help of too many
physicians." - Alexander the Great, on his deathbed
===============================
WenSui Liu
(http://spaces.msn.com/statcompute/blog)



More information about the R-help mailing list