Book Image

Hands-On Exploratory Data Analysis with R

By : Radhika Datar, Harish Garg
Book Image

Hands-On Exploratory Data Analysis with R

By: Radhika Datar, Harish Garg

Overview of this book

Hands-On Exploratory Data Analysis with R will help you build a strong foundation in data analysis and get well-versed with elementary ways to analyze data. You will learn how to understand your data and summarize its characteristics. You'll also study the structure of your data, and you'll explore graphical and numerical techniques using the R language. This book covers the entire exploratory data analysis (EDA) process—data collection, generating statistics, distribution, and invalidating the hypothesis. As you progress through the book, you will set up a data analysis environment with tools such as ggplot2, knitr, and R Markdown, using DOE Scatter Plot and SML2010 for multifactor, optimization, and regression data problems. By the end of this book, you will be able to successfully carry out a preliminary investigation on any dataset, uncover hidden insights, and present your results in a business context.
Table of Contents (17 chapters)
Free Chapter
1
Section 1: Setting Up Data Analysis Environment
7
Section 2: Univariate, Time Series, and Multivariate Data
11
Section 3: Multifactor, Optimization, and Regression Data Problems
14
Section 4: Conclusions

Multi-factor variance analysis

To understand the correlation between the variables, it is important to understand the interaction between all the variables within the dataset. Let's focus on multi-factor variance analysis of the data frame specified with the help of the following steps:

  1. Create an aggregate value of the data frame with respect to the mpg and displacement values mentioned as follows:
> d <- aggregate(mpg ~ displacement, data = Autompg, FUN = mean)

> d
displacement mpg

1 68.0 29.00000
2 70.0 20.23333
3 71.0 31.50000
4 72.0 35.00000
5 76.0 31.00000
6 78.0 32.80000
7 79.0 32.18333
8 80.0 21.50000
9 81.0 35.10000
10 83.0 32.00000
>
print(abs(d[[2]][1]-d[[2]][2]))

[1] 8.7666
67
  1. Now, let's build a...