Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Exploratory Data Analysis with R

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

Product type Book
Published in May 2019
Publisher Packt
ISBN-13 9781789804379
Pages 266 pages
Edition 1st Edition
Languages
Authors (2):
Radhika Datar Radhika Datar
Profile icon Radhika Datar
Harish Garg Harish Garg
Profile icon Harish Garg
View More author details
Toc

Table of Contents (17) Chapters close

Preface 1. Section 1: Setting Up Data Analysis Environment
2. Setting Up Our Data Analysis Environment 3. Importing Diverse Datasets 4. Examining, Cleaning, and Filtering 5. Visualizing Data Graphically with ggplot2 6. Creating Aesthetically Pleasing Reports with knitr and R Markdown 7. Section 2: Univariate, Time Series, and Multivariate Data
8. Univariate and Control Datasets 9. Time Series Datasets 10. Multivariate Datasets 11. Section 3: Multifactor, Optimization, and Regression Data Problems
12. Multi-Factor Datasets 13. Handling Optimization and Regression Data Problems 14. Section 4: Conclusions
15. Next Steps 16. Other Books You May Enjoy

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}