Say I had a rough multi linear regression model: Y = intercept + Aa + Bb + Cc + Dd + Ee. I would like to know if it is possible to use R, specifically the lm command, to input or set my betas as A = 2, B= -10, C = 3, D = 0, E = 7, and apply summary(lm) inorder to look at the effect of these predetermined betas on the intercept.

I was considering using the I function for example I(2*a) for A = 2 but I don't think that would work because it is just scaling those values.

1 Answers

Hongchao Qi On Best Solutions

You can try a transformed dependent variable y'.


In this formula, y is a matrix contains values of initial dependent variable (a N*1 matrix in this case), X is the design matrix of independent variables (a N*5 matrix in this case), and beta is the vector of your fixed regression coefficients, i.e., beta = c(2, -10, 3, 0, 7).

You can fit an intercept-only linear regression model with transformed dependent variable.