Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
R Data Science Essentials

You're reading from  R Data Science Essentials

Product type Book
Published in Jan 2016
Publisher
ISBN-13 9781785286544
Pages 154 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

R Data Science Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Getting Started with R Exploratory Data Analysis Pattern Discovery Segmentation Using Clustering Developing Regression Models Time Series Forecasting Recommendation Engine Communicating Data Analysis Index

Inferential statistics


We have seen a sufficient number of descriptive statistics techniques. Now, let's check some of the inferential statistics techniques. Inferential statistics is used to infer properties about the dataset.

First, let's start with the simple mean and check what should be the range if the mean has to fall under the confidence interval of 95%. In order to get the confidence interval for the mean, we need to load the lsr package; if the package is not already installed, you need to install it using the install.packages function and then the ciMean function to get the desired result:

library(lsr)
ciMean(tdata$Fare)

The following is the output of the preceding command:

The ciMean function gives us an overall view on the confidence interval of the Fare variable. However, to see how different it is between male and female, we can use the aggregate function:

aggregate( tdata$Fare ~ tdata$Sex, tdata, ciMean )

The output of the preceding is as follows:

From the preceding output,...

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 $15.99/month. Cancel anytime}