I am confused about the terminology used when discussing the logistic GLM.
When dealing with any glm, we have that for the response $Y_i$:
$$ E(Y_i) = \mu_i $$ and $$ g(\mu_i)= x_i^T \beta = \eta_i $$
where $x_i^T$ is the transpose of a vector of covariates, and $\beta$ is a vector of parameters to be estimated.
Now, in the case of the logistic, we have that $Y_i$ is the number of successes in a population of $n_i$ with probability of success $\pi_i$, I understand that this implies $Y_i \sim Bin(n_i, \pi_i)$ we are then told that $$ logit(\pi_i) = x_i^T \beta $$ that is, the link function $g(x) = logit (x)$. But this is confusing, since $\mu_i = n_i \pi_i$.
So are we modelling $E(Y_i)$ here? or are we modelling $E(Y_i)/n_i$. This is particularly annoying as I am trying to find:
$$ \frac{\partial \eta_i }{\partial \mu_i} $$
edit Maybe I should explain more why I am confused. In the text by Dobson it states that the solution of the parameter vector $\beta$ using the Newton raphson algorithm is given as :
$$ X^T W X b^{(m)} = X^TWZ $$ where this specifices the $m$-th iteration of the estimate of $\beta$. Now, $W$ is defined as a square diagonal matrix with :
$$ w_{ii} = \frac{1}{Var(Y_i)} \left( \frac{\partial \mu_i}{\partial \eta_i}\right)^2 $$
Now, according to the wiki, we have that $$ Y_i \sim Bern(\pi_i) $$
This implies that $E(Y_i) = \mu_i = \pi_i$ and since logit$(\pi_i) = \eta_i$, we have that:
$$ \frac{\partial \mu_i}{\partial \eta_i} = \pi_i(1-\pi_i) $$
we also have that $Var(Y_i) = \pi_i (1- \pi_i)$. So then, the diagonal elements of $W$ are given as:
$$ w_{ii} = \pi_i ( 1- \pi_i) $$ but in equation 21 of the following source, the author states that the diagonal elements of $W$ should in fact be:
$$ w_{ii} = n_i\pi_i ( 1- \pi_i) $$
but this contradicts that $Y_i$ should be bernoulli..doesn't it?