[R] Constrained linear regression

Bert Gunter gunter.berton at gene.com
Sat Nov 26 15:58:21 CET 2011

Sounds like it is  or could be considered a mixtures problem. Check
out the FlexMix package, which looks like it should do exactly what
you want. (But maybe not, so look carefully).

-- Bert

On Sat, Nov 26, 2011 at 6:10 AM, Julia Lira <julia.lira at hotmail.co.uk> wrote:
> Dear all,
> I need to run a simple linear regression such that:
> y = b0 + b1*x1 + (1-b1)*x2 + e
> which I know I can use:
> lm(y ~ I(x1 - x2) + offset(x2)).
> However, I also need to restrict the coefficient b1 to be between 0 and 1.
> Is there any way to include such restriction in the linear regression estimation?
> I saw suggestion related with the function Solve.QP, but I really did not understand such method.
> Thanks in advance,
> Julia
>        [[alternative HTML version deleted]]
> ______________________________________________
> 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.


Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374

More information about the R-help mailing list