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.

  • $\begingroup$ 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. $\endgroup$
    – Ott Toomet
    Commented Nov 13, 2015 at 22:40

1 Answer 1


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.

The term you are looking for is to add an "offset" to the linear predictor, that is,

$$ \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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.