# Can someone explain what is generalized linear model? Examples?

1. Mar 27, 2012

### kulimer

What exactly is generalized linear model?

I understand you have to use the link function.

Wikipedia says: "The link function provides the relationship between the linear predictor and the mean of the distribution function."
So, what is this RELATIONSHIP?

Maybe someone can provide an intuition and example?

Here I have:
g(p) = log(p/(1-p))

Last edited: Mar 27, 2012
2. Mar 28, 2012

### camillio

Hi kulimer,

the idea of the link function is that it transforms the linear predictor so that the mean value of the dependent variable is equal to it, namely $\mathbb{E}[Y] = g^{-1}(X\beta)$, where $X, \beta$ are the regressor and parameter, respectively.

Let's have the ordinary linear regression. Then, the link function is just an identity, $g(x) = x$. You get the well-known $Y = X\beta$.

However, there are dependent variables $Y$ which have some constraints. E.g., $Y$ can be dichotomous, taking values $\{0, 1\}$. Then the ordinary linear regression will not work and you need to exploit some suitable transformation. And that's what the link function does. By choosing
$$g(p) = \log \frac{p}{1-p},$$
you get the logistic regression with a logistic (aka sigmoid) function whose range is in $[0, 1]$, intersecting 0.5 at $p=0$. So it "models probability" of $p$ being 1.