please follow the requirements to complete the question I attached. some of the question need to use R studio to complete. let me know if you have any other questions.