Cox, N. (2005). Depending on conditions: a tutorial on the cond() function. The Stata Journal, 5, 413-420