Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hey, Can I please get an answer to this assignment? thank you. this is done in R studio : Please follow the R code to
Hey, Can I please get an answer to this assignment? thank you.
this is done in R studio :
Please follow the R code to
- Please read data and create training data (70%) and validation data (30%)
- Build a multiple regression model-- the median house price (MEDV) as target variable and CRIM, CHAS, and RM as input variables (the explanations of the columns are available at page. 169 or Problem 1 at the end of the chapter)
- Test the model on the validation data set.
- In a word file, write the equation of the model and compare the model's performance on the training data and validation data (accuracy function)
- Include all variables (except CAT..MEDV) as predictors to predict MEDV. Please use stepwise regression (both). Test the final model on the validation data
- Write the equation of the model in the word file.
For the data, i can't attach the data set but here is a sample that has 506 lines total. and for training sample we can use 300 spiceman
CRIM | ZN | INDUS | CHAS | NOX | RM | AGE | DIS | RAD | TAX | PTRATIO | LSTAT | MEDV | CAT. MEDV |
0.00632 | 18 | 2.31 | 0 | 0.538 | 6.575 | 65.2 | 4.09 | 1 | 296 | 15.3 | 4.98 | 24 | 0 |
0.02731 | 0 | 7.07 | 0 | 0.469 | 6.421 | 78.9 | 4.9671 | 2 | 242 | 17.8 | 9.14 | 21.6 | 0 |
0.02729 | 0 | 7.07 | 0 | 0.469 | 7.185 | 61.1 | 4.9671 | 2 | 242 | 17.8 | 4.03 | 34.7 | 1 |
0.03237 | 0 | 2.18 | 0 | 0.458 | 6.998 | 45.8 | 6.0622 | 3 | 222 | 18.7 | 2.94 | 33.4 | 1 |
0.06905 | 0 | 2.18 | 0 | 0.458 | 7.147 | 54.2 | 6.0622 | 3 | 222 | 18.7 | 5.33 | 36.2 | 1 |
0.02985 | 0 | 2.18 | 0 | 0.458 | 6.43 | 58.7 | 6.0622 | 3 | 222 | 18.7 | 5.21 | 28.7 | 0 |
0.08829 | 12.5 | 7.87 | 0 | 0.524 | 6.012 | 66.6 | 5.5605 | 5 | 311 | 15.2 | 12.43 | 22.9 | 0 |
0.14455 | 12.5 | 7.87 | 0 | 0.524 | 6.172 | 96.1 | 5.9505 | 5 | 311 | 15.2 | 19.15 | 27.1 | 0 |
0.21124 | 12.5 | 7.87 | 0 | 0.524 | 5.631 | 100 | 6.0821 | 5 | 311 | 15.2 | 29.93 | 16.5 | 0 |
0.17004 | 12.5 | 7.87 | 0 | 0.524 | 6.004 | 85.9 | 6.5921 | 5 | 311 | 15.2 | 17.1 | 18.9 | 0 |
0.22489 | 12.5 | 7.87 | 0 | 0.524 | 6.377 | 94.3 | 6.3467 | 5 | 311 | 15.2 | 20.45 | 15 | 0 |
0.11747 | 12.5 | 7.87 | 0 | 0.524 | 6.009 | 82.9 | 6.2267 | 5 | 311 | 15.2 | 13.27 | 18.9 | 0 |
0.09378 | 12.5 | 7.87 | 0 | 0.524 | 5.889 | 39 | 5.4509 | 5 | 311 | 15.2 | 15.71 | 21.7 | 0 |
0.62976 | 0 | 8.14 | 0 | 0.538 | 5.949 | 61.8 | 4.7075 | 4 | 307 | 21 | 8.26 | 20.4 | 0 |
0.63796 | 0 | 8.14 | 0 | 0.538 | 6.096 | 84.5 | 4.4619 | 4 | 307 | 21 | 10.26 | 18.2 | 0 |
0.62739 | 0 | 8.14 | 0 | 0.538 | 5.834 | 56.5 | 4.4986 | 4 | 307 | 21 | 8.47 | 19.9 | 0 |
1.05393 | 0 | 8.14 | 0 | 0.538 | 5.935 | 29.3 | 4.4986 | 4 | 307 | 21 | 6.58 | 23.1 | 0 |
0.7842 | 0 | 8.14 | 0 | 0.538 | 5.99 | 81.7 | 4.2579 | 4 | 307 | 21 | 14.67 | 17.5 | 0 |
0.80271 | 0 | 8.14 | 0 | 0.538 | 5.456 | 36.6 | 3.7965 | 4 | 307 | 21 | 11.69 | 20.2 | 0 |
0.7258 | 0 | 8.14 | 0 | 0.538 | 5.727 | 69.5 | 3.7965 | 4 | 307 | 21 | 11.28 | 18.2 | 0 |
1.25179 | 0 | 8.14 | 0 | 0.538 | 5.57 | 98.1 | 3.7979 | 4 | 307 | 21 | 21.02 | 13.6 | 0 |
0.85204 | 0 | 8.14 | 0 | 0.538 | 5.965 | 89.2 | 4.0123 | 4 | 307 | 21 | 13.83 | 19.6 | 0 |
1.23247 | 0 | 8.14 | 0 | 0.538 | 6.142 | 91.7 | 3.9769 | 4 | 307 | 21 | 18.72 | 15.2 | 0 |
0.98843 | 0 | 8.14 | 0 | 0.538 | 5.813 | 100 | 4.0952 | 4 | 307 | 21 | 19.88 | 14.5 | 0 |
0.75026 | 0 | 8.14 | 0 | 0.538 | 5.924 | 94.1 | 4.3996 | 4 | 307 | 21 | 16.3 | 15.6 | 0 |
0.84054 | 0 | 8.14 | 0 | 0.538 | 5.599 | 85.7 | 4.4546 | 4 | 307 | 21 | 16.51 | 13.9 | 0 |
0.67191 | 0 | 8.14 | 0 | 0.538 | 5.813 | 90.3 | 4.682 | 4 | 307 | 21 | 14.81 | 16.6 | 0 |
0.95577 | 0 | 8.14 | 0 | 0.538 | 6.047 | 88.8 | 4.4534 | 4 | 307 | 21 | 17.28 | 14.8 | 0 |
0.77299 | 0 | 8.14 | 0 | 0.538 | 6.495 | 94.4 | 4.4547 | 4 | 307 | 21 | 12.8 | 18.4 | 0 |
1.00245 | 0 | 8.14 | 0 | 0.538 | 6.674 | 87.3 | 4.239 | 4 | 307 | 21 | 11.98 | 21 | 0 |
1.13081 | 0 | 8.14 | 0 | 0.538 | 5.713 | 94.1 | 4.233 | 4 | 307 | 21 | 22.6 | 12.7 | 0 |
1.35472 | 0 | 8.14 | 0 | 0.538 | 6.072 | 100 | 4.175 | 4 | 307 | 21 | 13.04 | 14.5 | 0 |
1.38799 | 0 | 8.14 | 0 | 0.538 | 5.95 | 82 | 3.99 | 4 | 307 | 21 | 27.71 | 13.2 | 0 |
1.15172 | 0 | 8.14 | 0 | 0.538 | 5.701 | 95 | 3.7872 | 4 | 307 | 21 | 18.35 | 13.1 | 0 |
1.61282 | 0 | 8.14 | 0 | 0.538 | 6.096 | 96.9 | 3.7598 | 4 | 307 | 21 | 20.34 | 13.5 | 0 |
0.06417 | 0 | 5.96 | 0 | 0.499 | 5.933 | 68.2 | 3.3603 | 5 | 279 | 19.2 | 9.68 | 18.9 | 0 |
0.09744 | 0 | 5.96 | 0 | 0.499 | 5.841 | 61.4 | 3.3779 | 5 | 279 | 19.2 | 11.41 | 20 | 0 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started