In logistic regression, the regression coefficients ($\hat{\beta_0}, \hat{\beta_1}$) are calculated via the general method of maximum likelihood. For a simple logistic regression, the maximum likelihood function is given as


What is the maximum likelihood function for 2 predictors? Or 3 predictors?


1 Answer 1


The same for any finite number of predictors, i.e., $$ p(y_i;\vec{x_{i}})=\frac{1}{1+\exp\{-x_i'\beta\}}, $$ where $x_i=(1, x_{1i},...,x_{pi})$ and $\beta=(\beta_0,...,\beta_p)$. Thus the likelihood function is Binomial $$ \mathcal{L}(\beta)=\prod_{i=1}^m p(y_i;\vec{x_{i}})^{y_i} (1-p(y_i;\vec{x_{i}}))^{1-y_{i}}. $$

E.g., if you have two predictors, i.e., $x_1$ and $x_2$, and total of $n$ observations, i.e., $\{(y_i, x_{1i}, x_{2i}\}$ then the likelihood function is given by $$ \prod_{i=1}^n p(y_i; x_{1i}, x_{2i})^{y_i} (1-p(y_i; x_{1i}, x_{2i}))^{1-y_{i}}, $$ where $$ p(y_i; x_{1i}, x_{2i})=\frac{1}{1+\exp\{-\beta_0 + \beta_1x_{1i}+\beta_2x_{2i}\}}. $$

  • 1
    $\begingroup$ oh dear, looks like what you just typed was unrecognizable to me hahaha... would it be possible to give a simple example? e.g. two predictors? $\endgroup$
    – hongsy
    Nov 19, 2016 at 17:20
  • $\begingroup$ Pls see the edited answer. $\endgroup$
    – V. Vancak
    Nov 19, 2016 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .