Codes in STATA for the problems

Click Chpater4.do link to view the file.