Re: [R] Constraint on regression parameters

2013-10-17 Thread Greg Snow
You want the offset function in the formula: lm( A ~ B + I(B^2) + offset(C), data=Dataset) This will force the coefficient on C to be 1, if you wanted a coefficient of another value then just do the multiplication yourself, e.g. offset( 2 * C ) for a slope of 2. Also you can use poly(B,2) to fit

Re: [R] Constraint on regression parameters

2013-10-17 Thread S Ellison
> -Original Message- > I am doing a polynomial linear regression with 2 independent variables > such as : > > lm(A ~ B + I(B^2) + I(lB^3) + C, data=Dataset)) > > R return me a coefficient per independent variable, and I  would need > the coefficient of the C parameter to equal 1. Leavi

[R] Constraint on regression parameters

2013-10-17 Thread Robert U
Dear all, I have been trying to  find a simple solution to my problem without success, though i have a feeling a simple syntaxe detail coul make the job. I am doing a polynomial linear regression with 2 independent variables such as : lm(A ~ B + I(B^2) + I(lB^3) + C, data=Dataset)) R return me