0
$\begingroup$

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.

$\endgroup$
  • $\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 Nov 13 '15 at 22:40
3
$\begingroup$

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.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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