Variance covariance matrix of parameters in logistic regression? The given below image is taken from book Introduction to Linear Regression Analysis (Douglas C Montgomery) My apologies in advance for not typing , I just want to understand the concept.
(1) First Question
We are estimating the parameters in logistic regression by Maximum Likelihood Estimation concept. The thing I am not able to get in this image is - what is $n_{i}$ and how the expression is obtained.( Doubt already marked by violet arrow; the highlighted yellow expression is the same as in above equation.)

$\ $
$\ $
(2) Second Question
This $n_i$ expression is also involved in the variance of parameters(see below picture). But in these links - Link 1 and Link 2, $n_i$ is not mentioned anywhere in the discussion.

Could someone help me to understand this thing?

The first display is a bit confusing, because it uses the symbol $n$ in two different ways. For the upper limit of the products and sums, it's the total number of "observations." But the symbol $n_i$ is later meant to represent the number of trials on "observation" $i$.*
I find it easier to work backward from Equation 13.9. If there were $n_i$ total trials on "observation" $i$ and $y_i$ of them had positive outcomes with an underlying probability $\pi_i$ (based e.g. on covariate values), then $n_i-y_i$ had negative outcomes with a corresponding probability $1-\pi_i$. That directly gives the result for the log-likelihood shown in Equation 13.9. If you then set $n_i = 1$, recognize that
$$y_i \ln \left( \frac{\pi_i}{1-\pi_i} \right)= y_i \ln \pi_i - y_i \ln(1-\pi_i)$$
and figure out that the bare $\pi$ in your first highlighted region should be the "observation"-specific $\pi_i$ (misprints do happen), then you should be able to show that the (corrected) equation at the top of page 425 is for the special situation of Equation 13.9 in which each "observation" only has a single trial.
With respect to the second part of your question, this answer shows that iteratively reweighed least squares is equivalent to a standard numerical search method in the case of a binomial model with a logit link. With $n_i$ still representing the number of trials on "observation" $i$, the formula $V_{ii} = n_i \hat \pi_i (1-\hat\pi_i)$ is the plug-in estimate of the binomial variance based on the estimate $\hat \pi_i$ for the true probability $\pi_i$ when there are $n_i$ trials. If there is only a single trial per "observation," that's just $\hat \pi_i (1-\hat \pi_i)$, the form shown in the links you provide (which implicitly assume one "trial" per "observation" in the terminology used by this cited text).

*The cited text seems to use "observation" to represent all cases that have the same set of covariate values. I tend to think of an "observation" as being the result of a single trial. I would have found it easier to follow had the word "case" been used instead.
