Generalized linear models with clustering