Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
- data(iris) # load iris data
- head(iris) # peek at the data
- unique(iris$Species) # look at unique species
- plot(iris[1:4]) # Scatterplot matrix
- x <- iris$Petal.Length
- y <- iris$Petal.width
- model <- lm(y ~ x) # simple linear regression model
- lines (
x = iris$Petal.Length,
y = model$fitted,
col = red
lwd = 3)
- cor (
x = iris$Petal.Length,
y = iris$Petal.Width) # Get Correlation Coefficient
- summary (model) # Summarize the Model
- predict (
object = model,
newdata = data.frame(x = c(2,5,7)))
- 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
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