Need an R code for the below questions and required necessary explanations and equations. I have attached

Posted Date: