Skip to Content
RStudio for R Statistical Computing Cookbook
book

RStudio for R Statistical Computing Cookbook

by Andrea Cirillo
April 2016
Beginner to intermediate content levelBeginner to intermediate
246 pages
5h 20m
English
Packt Publishing
Content preview from RStudio for R Statistical Computing Cookbook

Detecting and removing outliers

Outliers are usually dangerous values for data science activities, since they produce heavy distortions within models and algorithms.

Their detection and exclusion is, therefore, a really crucial task.

This recipe will show you how to easily perform this task.

We will compute the I and IV quartiles of a given population and detect values that far from these fixed limits.

You should note that this recipe is feasible only for univariate quantitative population, while different kind of data will require you to use other outlier-detection methods.

How to do it...

  1. Compute the quantiles using the quantile() function:
    quantiles <- quantile(tidy_gdp_complete$gdp, probs = c(.25, .75))
    
  2. Compute the range value using the IQR() function: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Data Analysis Using Jupyter Notebook

Practical Data Analysis Using Jupyter Notebook

Marc Wintjen

Publisher Resources

ISBN: 9781784391034Supplemental Content