exercise 3 5 points for this exercise the only extra package allowed i
Exercise 3. (5 points) For this exercise, the only extra package allowed is ISLR2. The datset
Boston will be used throughout the exercise and is accessible through the ISLR2 package.
We are interested in predicting medv given a single input variable from among the three
variables crim, rm and ptratio. We ran three regressions in R using each one of the three
variables as a single input variable. Then, we computed the average squared error between our
predictions for medv and the actual observed values of medv over the whole sample. We got
the following figure.
Figure 4. Model Comparison
a) Write the R code to reproduce that plot. Explain the details of any calculations required.
b) Based on this plot, does it make sense to say that the best model among the three is
the one that uses rm as input? Or should it be the one that uses crim instead? Or
*The amount will be in form of wallet points that you can redeem to pay upto 10% of the price for any assignment. **Use of solution provided by us for unfair practice like cheating will result in action from our end which may include permanent termination of the defaulter’s account.Disclaimer:The website contains certain images which are not owned by the company/ website. Such images are used for indicative purposes only and is a third-party content. All credits go to its rightful owner including its copyright owner. It is also clarified that the use of any photograph on the website including the use of any photograph of any educational institute/ university is not intended to suggest any association, relationship, or sponsorship whatsoever between the company and the said educational institute/ university. Any such use is for representative purposes only and all intellectual property rights belong to the respective owners.