Question: Goal is to build a Multiple Linear Regression Model in R. Please take the screenshots of the outputs from each step and include in the

Goal is to build a Multiple Linear Regression Model in R.

Please take the screenshots of the outputs from each step and include in the word document. Explain the Outputs in each step as per your understanding.

  1. data(iris) # load iris data
  2. head(iris) # peek at the data
  3. unique(iris$Species) # look at unique species
  4. plot(iris[1:4]) # Scatterplot matrix
  5. x <- iris$Petal.Length
  6. y <- iris$Petal.width
  7. model <- lm(y ~ x) # simple linear regression model
  8. lines (

x = iris$Petal.Length,

y = model$fitted,

col = red

lwd = 3)

  1. cor (

x = iris$Petal.Length,

y = iris$Petal.Width) # Get Correlation Coefficient

  1. summary (model) # Summarize the Model
  2. predict (

object = model,

newdata = data.frame(x = c(2,5,7)))

  1. Now add one more variable to your Model and repeat the steps from 5 to 11. (Multiple Linear Regression Model).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!