# How to fix some coefficients when fitting a logistic regression

In linear regression, if I have a model,

b0 + b1x1 + b2x2 + b3x3 + b4x4 = y


and I want to fix some of the coefficients ,say b1 = 1 and b3 = 2, I could just do the following

b0 + b2x2 + b4x4 = y - x1 - 2x3


and just fit a linear regression on the other three parameters on the new y. Is there a way to do this for logistic regression? The sigmoid function seems to complicate things. Im looking to do this in r, so if theres an easy way to do it in r, that would be very appreciated.

• I would take the likelihood function and estimate this while keeping b1=1 and b3=2 (in R, maxLik does this). Logistic likelihood is pretty easy to write, but definitely more complex than what you do with OLS. Commented Nov 13, 2015 at 22:40

The linear predictor in logistic regression (or any GLM) is the $n$-vector $$\boldsymbol{\eta} = \mathbf X \beta$$ where $\mathbf X$ is a $n \times p$ design matrix and $\beta$ is a $p$-vector of parameters.
$$\boldsymbol{\eta} = \mathbf X \beta + \mathbf z$$ for $\mathbf z$ a fixed $n$-vector.
In R you can do that with glm(response ~ covariates, offset=z). This most often arises with Poisson models under a log link where the offset might be proportional to the time-interval or area of each unit of observation.