I would like to understand how linear.predictors are computed in the output of
pb = glm(formula, family = binomial( link = "probit" ), data)
From my understanding, it should be the product matrix of the observations (N x k) and the estimated coefficients (k x 1), with N = sample size, k = number of variables.
I tried to compute them by hand in two fashions:
rowSums(mapply(`*`,pb$model,pb$coefficients))
and
as.matrix(pb$model)%*%as.matrix(pb$coefficients)
Both gave me the same vector of values that equals pb$linear.predictors for some observations but not all.
Could you help me understand how it is computed and how I could reproduce it by hand?