Reader small image

You're reading from  Hands-On Exploratory Data Analysis with R

Product typeBook
Published inMay 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789804379
Edition1st Edition
Languages
Tools
Right arrow
Authors (2):
Radhika Datar
Radhika Datar
author image
Radhika Datar

Radhika Datar has more than 5 years' experience in software development and content writing. She is well versed in frameworks such as Python, PHP, and Java, and regularly provides training on them. She has been working with Educba and Eduonix as a training consultant since June 2016, while also working as a freelance academic writer in data science and data analytics. She obtained her master's degree from the Symbiosis Institute of Computer Studies and Research and her bachelor's degree from K. J. Somaiya College of Science and Commerce.
Read more about Radhika Datar

Harish Garg
Harish Garg
author image
Harish Garg

Harish Garg is a Principal Software Developer, author, and co-founder of a software development and training company, Bignumworks. Harish has more than 19 years of experience in a wide variety of technologies, including blockchain, data science and enterprise software. During this time, he has worked for companies such as McAfee, Intel, etc.
Read more about Harish Garg

View More author details
Right arrow

Residual plots

A residual plot is a graph that displays the residuals on the vertical axis specified and the independent variable on the horizontal axis. In the event that the points in a residual plot are dispersed in a random manner around the horizontal axis, it is appropriate to use a linear regression model for the data. If the data is not dispersed, a non-linear model is more appropriate.

We can create and customize the residual plot using the steps mentioned as follows:

  1. Include the library within the R workspace. This is considered a mandatory step:
> library(ggplot2)
Attaching package: 'ggplot2'
The following object is masked _by_ '.GlobalEnv':
mpg
Warning message:
package 'ggplot2' was built under R version 3.5.3
  1. Use the required function, such as we did for scatter plots, to get the perpendicular plots arranged in a systematic manner:
  2. ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Exploratory Data Analysis with R
Published in: May 2019Publisher: PacktISBN-13: 9781789804379

Authors (2)

author image
Radhika Datar

Radhika Datar has more than 5 years' experience in software development and content writing. She is well versed in frameworks such as Python, PHP, and Java, and regularly provides training on them. She has been working with Educba and Eduonix as a training consultant since June 2016, while also working as a freelance academic writer in data science and data analytics. She obtained her master's degree from the Symbiosis Institute of Computer Studies and Research and her bachelor's degree from K. J. Somaiya College of Science and Commerce.
Read more about Radhika Datar

author image
Harish Garg

Harish Garg is a Principal Software Developer, author, and co-founder of a software development and training company, Bignumworks. Harish has more than 19 years of experience in a wide variety of technologies, including blockchain, data science and enterprise software. During this time, he has worked for companies such as McAfee, Intel, etc.
Read more about Harish Garg