I want to fit a linear regression with multiple independent variables. Say that I know that the coefficient of one variable is twice as large as the coefficient of another variable, or that one coefficient is the sum of two of the other coefficients. Is there a way to specify these known relationships and make the linear regression take them into account? Is there a program or programming language that lets one do this?
Asked
Active
Viewed 26 times
0
-
Related [question](https://stats.stackexchange.com/a/492324/7071). – dimitriy Mar 23 '21 at 21:48
-
independent yet they are related. me smells contradiction – Aksakal Mar 23 '21 at 22:08
-
This is just a matter of creating your variables, sometimes called "feature engineering." For instance, if you think the model should include $\cdots+\beta_i X_i + 2\beta_i X_j+\cdots,$ where the coefficient of $X_j$ is twice the coefficient of $X_i,$ then include the variable $X_i+2X_j$ in the model and leave out $X_i$ and $X_j.$ – whuber Mar 23 '21 at 22:24