RPubs will retire in June 2027.
Your existing documents will stay accessible through December 31, 2031
and
Connect Cloud
is the recommended home for new publishing.
Read the blog post
Econ 573 Advanced Econometrics and Machine Learning: Homework 2 that goes into Chapter 3 of the ISL. Also, my own code for the last two parts utilizing the information provided within a directions document