I’m looking for a way to specify the value of a predictor variable. When I run a glm with my current data, the coefficient for one of my variables is close to one. I’d like to set it at .8.
I know this will give me a lower R^2 value, but I know a priori that the predictive power of the model will be greater.
The weights component of glm looks promising, but I haven’t figured it out yet.
Any help would be greatly appreciated.
I believe you are looking for the
offsetargument inglm. So for example, you might do something like this:where in this case the coefficient of
x2would be set at 1. In your case, you may perhaps want to multiply that column by 0.8?To expand, here is what
?glmsays about theoffsetargument:So you can add offsets in the model formula itself using the
offset()function, as well. Here is a simple example illustrating its use:Note that the last two have the same coefficients.