Matrix Calculus and Zero-One Matrices: Statistical and Econometric Applications