ggplot2-solutions icon indicating copy to clipboard operation
ggplot2-solutions copied to clipboard

Exercise 10.3.2 #2 Trans to detect outliers

Open HossamGhorab opened this issue 3 years ago • 0 comments

The exercise is to know:

What transformation makes it easier to extract outliers?

https://github.com/kangnade/ggplot2-solutions/blob/e6ef9e3b271599f6e97afc0f8a3f012f276f9385/ggplot2_solutions_chapter10.Rmd#L188

I believe using the square root transformation can help identify extreme outliers first:

ggplot(diamonds, aes(x,z)) + stat_bin2d() + scale_y_sqrt() + scale_x_sqrt()

Then, the log10 transformation may be used for less distant outliers:

ggplot(diamonds, aes(x,z)) + stat_bin2d() + scale_y_log10() + scale_x_log10()

Warmly

HossamGhorab avatar Oct 16 '21 14:10 HossamGhorab