logistic regression
Given a binary respose variable $Y$ with probability of success $p$, the logistic regression^{} is a nonlinear regression model with the following model equation:
$$\mathrm{E}[Y]=\frac{\mathrm{exp}({\bm{X}}^{\mathrm{T}}\bm{\beta})}{1+\mathrm{exp}({\bm{X}}^{\mathrm{T}}\bm{\beta})},$$ 
where ${\bm{X}}^{\mathrm{T}}\bm{\beta}$ is the product^{} of the transpose^{} of the column matrix $\bm{X}$ of explanatory variables and the unknown column matrix $\bm{\beta}$ of regression coefficients. Rewriting this so that the right hand side is ${\bm{X}}^{\mathrm{T}}\bm{\beta}$, we arrive at a new equation
$$\mathrm{ln}\left(\frac{\mathrm{E}[Y]}{1\mathrm{E}[Y]}\right)={\bm{X}}^{\mathrm{T}}\bm{\beta}.$$ 
The left hand side of this new equation is known as the logit function, defined on the open unit interval $(0,1)$ with range the entire real line $\mathbb{R}$:
$$\mathrm{logit}(p):=\mathrm{ln}(\frac{p}{1p})\text{where}p\in (0,1).$$ 
Note that the logit of $p$ is the same as the natural log of the odds of success (over failures) with the probability of success = $p$. Since $Y$ is a binary response variable, so it has a binomial distribution with parameter (probability of success) $p=\mathrm{E}[Y]$, the logistic regression model equation can be rewritten as
$$\mathrm{logit}\left(\mathrm{E}[Y]\right)=\mathrm{logit}(p)={\bm{X}}^{\mathrm{T}}\bm{\beta}.$$  (1) 
Logistic regression is a particular type of generalized linear model. In addition, the associated logit function is the most appropriate and natural choice for a link function. By natural we mean that $\mathrm{logit}(p)$ is equal to the natural parameter $\theta $ appearing in the distribution function^{} for the GLM (generalized linear model). To see this, first note that the distribution function for a binomial random variable^{} $Y$ is
$$P(Y=y)=\left(\genfrac{}{}{0pt}{}{n}{y}\right){p}^{y}{(1p)}^{(ny)},$$ 
where $n$ is the number of trials and $Y=y$ is the event that there are $y$ success in these $n$ trials. $p$, the parameter, is the probability of success. Let there be $N$ iid binomial random variables ${Y}_{1},{Y}_{2},\mathrm{\dots},{Y}_{N}$ each corresponding to ${n}_{i}$ trials with ${p}_{i}$ probability of success. Then the joint probability distribution of these $N$ random variables is simply the product of the individual binomial distributions. Equating this to the distribution^{} for the GLM, which belongs to the exponential family of distributions, we have:
$$\prod _{i=1}^{N}\left(\genfrac{}{}{0pt}{}{{n}_{i}}{{y}_{i}}\right)p_{i}{}^{{y}_{i}}{(1{p}_{i})}^{({n}_{i}{y}_{i})}=\prod _{i=1}^{N}\mathrm{exp}\left[{y}_{i}{\theta}_{i}b({\theta}_{i})+c({y}_{i})\right].$$ 
Taking the natural log on both sides, we have the equality of loglikelihood function^{} in two different forms:
$$\sum _{i=1}^{N}\left[\mathrm{ln}\left(\genfrac{}{}{0pt}{}{{n}_{i}}{{y}_{i}}\right)+{y}_{i}\mathrm{ln}{p}_{i}+({n}_{i}{y}_{i})\mathrm{ln}(1{p}_{i})\right]=\sum _{i=1}^{N}\left[{y}_{i}{\theta}_{i}b({\theta}_{i})+c({y}_{i})\right].$$ 
Rearranging the left hand side and comparing term $i$, we have
$${y}_{i}\mathrm{ln}(\frac{{p}_{i}}{1{p}_{i}})+{n}_{i}\mathrm{ln}(1{p}_{i})+\mathrm{ln}\left(\genfrac{}{}{0pt}{}{{n}_{i}}{{y}_{i}}\right)={y}_{i}{\theta}_{i}b({\theta}_{i})+c({y}_{i}),$$ 
so that ${\theta}_{i}=\mathrm{ln}\left({p}_{i}/(1{p}_{i})\right)=\mathrm{logit}({p}_{i})$.
Next, setting the natural link function logit of the expected value^{} of ${Y}_{i}$, which is ${p}_{i}$, to the linear portion of the GLM, we have
$$\mathrm{logit}({p}_{i})=\bm{X}_{i}{}^{\mathrm{T}}\bm{\beta},$$ 
giving us the model formula^{} for the logistic regression.
Remarks.

•
Comparing model equation for the logistic regression to that of the normal or Gaussian linear regression model, we see that the difference is in the choice of link function. In normal liner model, the regression equation looks like
$$\mathrm{E}[Y]={\bm{X}}^{\mathrm{T}}\bm{\beta}.$$ (2) The link function in this case is the identity function^{}. The model equation is consistent^{} because the linear terms on the right hand side allow $\mathrm{E}[Y]$ on the left hand side to vary over the reals. However, for a binary response variable, Equation (2) would not be appropriate as the left hand side is restricted to only within the unit interval, whereas the right hand side has the possibility of going outside of $(0,1)$. Therefore, Equation (1) is more appropriate when we are dealing with a binary response data variable.

•
The logit function is not the only choice of link function for the logistic regression. Other, “nonnatural” link functions are available. Two such examples are the probit function^{}, or the inverse^{} cumulative normal distribution function ${\mathrm{\Phi}}^{1}(p)$ and the complimentaryloglog function $\mathrm{ln}(\mathrm{ln}(1p))$. Both of these functions map the open unit interval to $\mathbb{R}$.
Title  logistic regression 

Canonical name  LogisticRegression 
Date of creation  20130322 14:47:51 
Last modified on  20130322 14:47:51 
Owner  CWoo (3771) 
Last modified by  CWoo (3771) 
Numerical id  12 
Author  CWoo (3771) 
Entry type  Definition 
Classification  msc 62J12 
Classification  msc 62J02 
Defines  logit 
Defines  probit 
Defines  complementaryloglog 