[R] Constrained linear regression

2011-11-26 Thread Julia Lira
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

Re: [R] Constrained linear regression

2011-11-26 Thread Bert Gunter
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.l...@hotmail.co.uk wrote: Dear all, I need to run a