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.
 A: 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.  
A more general question, setting aside generalized linear models, is why we might want to predict means at all.  First, the mean is the expected value.  Moreover, for distributions in the exponential family (which means they are applicable for the GLiM) the mean is one of the parameters of the distribution.  If you know that the distribution is something or other, and you know the mean, you basically know everything there is know, or at least much of it.  (Some distributions have additional parameters that you would still want to estimate, for example, for the normal you would want to know the variance as well.)  
You don't have to want to know the mean, however.  You might want to know the value of some quantile, for example the 37th percentile.  You can model that with quantile regression.  Ordinal logistic regression and the Cox proportional hazards model don't assume distributional forms and aren't estimating conditional means in a direct sense.  
