n this HW, you will develop a linear regression model that describe mileage (mpg) in the Auto dataset (ignore the origin and name columns) using forward selection, Divide the data into a training dataset (80%) and a testing dataset (20%) Use forward selection on the training dataset to find the three most important parameters that affect mpg: use minimum residual sum of squares (RSS) value as the rule for variable selection. Include tables of computed model parameters and their p-values. Apply the obtained model to the testing dataset. Compare results with the performance on the training data I am using R to code this so far this is what I have 1- data <- read.csv("Auto.csv") split_data <- sample(c(rep(0, 0.8 * nrow(data)), rep(1, 0.2 * nrow(data)))) 2- model_train <- lm(formula = mpg ~ cyl+ disp + hp + w

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

In this HW, you will develop a linear regression model that describe mileage (mpg) in the Auto dataset (ignore the origin and name columns) using forward selection,

  1. Divide the data into a training dataset (80%) and a testing dataset (20%)
  2. Use forward selection on the training dataset to find the three most important parameters that affect mpg: use minimum residual sum of squares (RSS) value as the rule for variable selection. Include tables of computed model parameters and their p-values.
  3. Apply the obtained model to the testing dataset. Compare results with the performance on the training data

I am using R to code this so far this is what I have

1-

data <- read.csv("Auto.csv")

split_data <- sample(c(rep(0, 0.8 * nrow(data)), rep(1, 0.2 * nrow(data))))

2-

model_train <- lm(formula = mpg ~ cyl+ disp + hp + wght+ acc + year, data = data[split_data == 0, ])

not sure what to do next, any help? 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY