Reader small image

You're reading from  Learning Predictive Analytics with R

Product typeBook
Published inSep 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781782169352
Edition1st Edition
Languages
Right arrow
Author (1)
Eric Mayor
Eric Mayor
author image
Eric Mayor

Eric Mayor is a senior researcher and lecturer at the University of Neuchatel, Switzerland. He is an enthusiastic user of open source and proprietary predictive analytics software packages, such as R, Rapidminer, and Weka. He analyzes data on a daily basis and is keen to share his knowledge in a simple way.
Read more about Eric Mayor

Right arrow

Robust regression


In the example datasets that we used in this chapter, we have seen that some observations might threaten the reliability of our results, because of the deviations of their residuals from a normal distribution. The Shapiro test performed on the residuals of model1 (nurses dataset) has shown that the distribution of the residuals was not significantly different from a normal distribution. However, let's be particularly cautious and analyze the same data using robust regression.

As we mentioned earlier, robust regression does not require the residuals to be normally distributed, and therefore, fits our purpose. We will not explore the algorithm. For details about this, the reader can consult Robust Regression in R by Fox and Weisberg (2012). Here, we simply perform robust regression using the rlm() function of the MASS package. Let's first install and load it:

install.packages("MASS"); library(MASS)
model1.rr = rlm(Commit ~ Exhaus + Depers + Accompl, data = nurses)
summary(model1...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Predictive Analytics with R
Published in: Sep 2015Publisher: PacktISBN-13: 9781782169352

Author (1)

author image
Eric Mayor

Eric Mayor is a senior researcher and lecturer at the University of Neuchatel, Switzerland. He is an enthusiastic user of open source and proprietary predictive analytics software packages, such as R, Rapidminer, and Weka. He analyzes data on a daily basis and is keen to share his knowledge in a simple way.
Read more about Eric Mayor