[R] Constraint on regression parameters

S Ellison S.Ellison at LGCGroup.com
Thu Oct 17 12:22:30 CEST 2013

> -----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.

Leaving aside the question of fitting simple polynomial coefficients instead of orthogonal polynomials - generally frowned upon, but not always serious - the problem you describe is one in which you are not fitting C at all; you're assuming C adds exactly. What you're really fitting is the difference between A and C. 

Try fitting 
A-C ~ B + I(B^2) + I(lB^3) 

to obtain the coefficients you're looking for. But be aware that you will still have a constant intercept, so the model you will have fitted is

A = b0 + b1.B +b2.B^2 +b3.B^3 + C + error

S Ellison

This email and any attachments are confidential. Any use...{{dropped:8}}

More information about the R-help mailing list