Sonia Ayers

Answered

2022-07-09

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

$\ell ({\beta}_{0},{\beta}_{1})=\prod _{i:{y}_{i}=1}p({x}_{i})\prod _{{i}^{\prime}:{y}_{{i}^{\prime}}=0}(1-p({x}_{{i}^{\prime}})).$

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

$\ell ({\beta}_{0},{\beta}_{1})=\prod _{i:{y}_{i}=1}p({x}_{i})\prod _{{i}^{\prime}:{y}_{{i}^{\prime}}=0}(1-p({x}_{{i}^{\prime}})).$

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

Answer & Explanation

Darrell Valencia

Expert

2022-07-10Added 10 answers

The same for any finite number of predictors, i.e.,

$p({y}_{i};\overrightarrow{{x}_{i}})=\frac{1}{1+\mathrm{exp}\{-{x}_{i}^{\prime}\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};\overrightarrow{{x}_{i}}{)}^{{y}_{i}}(1-p({y}_{i};\overrightarrow{{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+\mathrm{exp}\{-{\beta}_{0}+{\beta}_{1}{x}_{1i}+{\beta}_{2}{x}_{2i}\}}.$

$p({y}_{i};\overrightarrow{{x}_{i}})=\frac{1}{1+\mathrm{exp}\{-{x}_{i}^{\prime}\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};\overrightarrow{{x}_{i}}{)}^{{y}_{i}}(1-p({y}_{i};\overrightarrow{{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+\mathrm{exp}\{-{\beta}_{0}+{\beta}_{1}{x}_{1i}+{\beta}_{2}{x}_{2i}\}}.$

Most Popular Questions