Developing Data Products Course Project (a simple approach to jitter())

arturocm
June 21st, 2015

How Jitter works

Understanding your raw data is as important as analyzing it this is something that a visualization approach can help you with. When you plot integer - or factor - variables much of the advantages of visualization slide away, UNLESS you understand a great function such as jitter()! This simple shinny app will let you plat with the jitter() function in both x and y axis for a plot with factor variables. It might not change the results of your predictive models, but it can sure help you understand your data

What is Jitter()

Jitter is a base function that add noise to a numeric vector. The function consist on 3 inputs:

  • x numeric vector to which jitter should be added.
  • factor numeric.
  • amount this is out of this shiny app scope

During the next slides we are going to use the airquality data from the datasets library

Original plot (Temp vs Month)

library(datasets)
plot(Temp~Month,data=airquality)

plot of chunk unnamed-chunk-1 Here you can see how all data points are oversocked on each value of the x axis

Jitter plot (Temp vs Month)

library(datasets)
plot(jitter(Temp, factor = 0.5)~jitter(Month, factor = 0.5), data=airquality)

plot of chunk unnamed-chunk-2

Shiny Apps + Jitter

As you can see, by playing with the factor values included in the jitter function you can have a better undestanding on how it works and more importantly how can it help you understand your data in just one function.

Thank you and good luck to you too!

arturocm