Below are the solutions to these exercises on Multiple Regression (part 3). data(state) state77 <- as.data.frame(state.x77) names(state77)[4] <- "Life.Exp" names(state77)[6] <- "HS.Grad" #################### # # # Exercise 1 # # # #################### #a. library(car) m1 <- lm(Life.Exp ~ HS.Grad+Murder, data=state77) avPlots(m1) #Note that the slope of the line is positive in the HS.Grad plot, and […]

## Multiple Regression (Part 3) Diagnostics

In the exercises below we cover some more material on multiple regression diagnostics in R. This includes added variable (partial-regression) plots, component+residual (partial-residual) plots, CERES plots, VIF values, tests for heteroscedasticity (nonconstant variance), tests for Normality, and a test for autocorrelation of residuals. These are perhaps not as common as what we have seen in […]

## Multiple Regression (Part 2) – Diagnostics

Multiple Regression is one of the most widely used methods in statistical modelling. However, despite its many benefits, it is oftentimes used without checking the underlying assumptions. This can lead to results which can be misleading or even completely wrong. Therefore, applying diagnostics to detect any strong violations of the assumptions is important. In the […]

## Multiple Regression (Part 2) Diagnostics – Solutions

Below are the solutions to these exercises on Multiple Regression (part 2). #################### # # # Exercise 1 # # # #################### #a. data(state) #b. state77 <- as.data.frame(state.x77) #c. names(state77)[4] <- “Life.Exp” names(state77)[6] <- “HS.Grad” #d. round(cor(state77),3) #displays correlations to 3 decimal places ## Population Income Illiteracy Life.Exp Murder HS.Grad Frost ## Population 1.000 0.208 […]

## Multiple Regression (Part 1)

In the exercises below we cover some material on multiple regression in R. Answers to the exercises are available here. If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page. We will be using the dataset state.x77, which […]

## Multiple Regression (Part 1) Solutions

Below are the solutions to these exercises on Multiple Regression (part 1). #################### # # # Exercise 1 # # # #################### #a. data(state) #b. state77 <- as.data.frame(state.x77) #c. names(state77)[4] <- “Life.Exp” names(state77)[6] <- “HS.Grad” #################### # # # Exercise 2 # # # #################### model <- lm(Life.Exp ~ ., data=state77) #the ‘.’ means ‘all’ […]