Foundations of Linear and Generalized Linear Models