Section A, Problem 3

Wrote a function to stick into apply for estimating the necessary
regressions.