# Basic question on link function in GLM

I am a stats & R beginner and am trying to understand GLMs. I have a very basic question on the link function which is the following

If I understand correctly the mean of the response variable Y is getting mapped to eta through the link function g(.)

My question is, why the mean? Is it that we are calculating a single value, namely the mean of Yi's? Why not use the Yi's themselves? A related question to the above is, that if we consider linear regression (which is a special case of GLM with link=identity), the response variable is NOT mean(Yi), but Yi. But according to GLM theory we should be using mean(yi) for the link function mapping.

Sorry if the question is very basic, and thanks in advance.

I have gone through many enlightening posts such as Meaning of link functions (GLM)

Difference between logit and probit models

but I couldn't find the answer, no doubt my limitation.

• Initially when we were using linear models, we were modelling the conditional expectation of Yi's. We simply want the domains of $\mathrm{E}\left(Y_{i}|\mathbf{X}\right)$ and $\mathbf{x}_{i}'\beta$ to match and link functions perfectly serve this purpose. If you transform the response variables themselves, then the distributional assumption that you made would change. – Daeyoung Lim Aug 21 '16 at 13:49
• This question, and its answers, may offer some insight: stats.stackexchange.com/questions/174390/… – Matthew Drury Aug 21 '16 at 15:30

All of the basic regression-type models that people use are for the mean. With OLS regression, where the response is assumed conditionally normal, your predicted values, $\hat y_i$, are the conditional means (cf., here). So in a GLiM context more broadly, where the response is distributed as something else like a Bernoulli, we also want to predict the mean.