An econometris question which has to use a statistic program economics homework help

This is an econometris question which has to use a statistic program

such as MATLAB or R or STATA or SPSS

I’m attaching the necessary data for this question as well

p.s. Please attach the codes and the name of the program you used in the answer.