This function calculates the mean of the response variable for a generalized linear model (GLM) based on the specified family. The calculation depends on whether the family is binomial or gaussian.
get_glm_mean(family_string, X, coefs)
Numeric vector. The computed mean of the response variable based on the specified family.
Character. The GLM family to use. Options are "binomial"
or "gaussian"
.
Matrix. The design matrix (predictors) for the GLM.
Numeric vector. The coefficients for the GLM.