The following programs are written in Python, MatLab, and STATA