'Linear model with some forced / preset coefficients in R

I am using a simple 3-variable model like this:

0 = b0 + b1x + b2y + b3z + b4xy + b5xz + b6yz + b7xyz

This is being used to describe synergism/antagonism between chemicals. b0 represents overall effect, b1-b3 are individual active effects of the chemicals, and b4-b7 are interactive effects.

I can get accurate coefficients using some pre-constructed data:

x1 <- c(0,1,2,3,4,1,2,3,4,1,2,3,4,5,6,7,8)
y1 <- c(0,2,1,5,4,3,7,5,8,6,2,1,5,5,3,5,7)
z1 <- c(0,1,-0.66667,-6,-7.25,-0.66667,-5.55556,-6,-6.125,-4,-2.5,-6,-6.8,-7.3913,-11.1429,-8.2069,-6.83333)

q <- c(-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

model <- lm(q ~ x1*y1*z1)

However, using some other tests (e.g. including noise) the results aren't as accurate as I would like. The good thing is that for this application it's easy enough to get values for b1, b2, and b3 (and set b0 as -1).

Is there a way in R to run this linear model, forcing values for b0-b3, and only solving for b4-b7?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source