How can I specify a relationship between parameter estimates in lm?
问题 Using lm, I would like to fit the model: y = b0 + b1*x1 + b2*x2 + b1*b2*x1*x2 My question is: How can I specify that the coefficient of the interaction should equal the multiplication of the coefficients the main effects? I've seen that to set the coefficient to a specific value you can use offset() and I() but I don't know how to specify a relationship between coefficient. Here is a simple simulated dataset: n <- 50 # Sample size x1 <- rnorm(n, 1:n, 0.5) # Independent variable 1 x2 <- rnorm