Source: https://web.stanford.edu/class/stats306a/RforGLM.pdf