Source: https://www3.nd.edu/~rwilliam/stats1/Categorical-Stata.pdf