3 ms·
Histograms are great for visualizing relative density, but they have problems when items don't sort neatly into bins. They also make it hard for viewers to acc
by tmoertel 14y ago
Histograms are great for visualizing relative density, but they have problems when items don't sort neatly into bins. They also make it hard for viewers to accurately estimate the portion of the distribution that falls within arbitrary ranges, say the percentage of smokers aged 24 thru 35. Plotting the empirical cumulative distribution function solves these problems.
For a numeric random variable X, its CDF F(x) gives P(X <= x). So if X gives the age of smokers, the answer to our earlier question is just F(35) less F(23). Plotting F over all values of X, then, lets us not only "see" the shape of the distribution but also answer range questions: just lookup two points on the graph and subtract.
Some examples:
http://docs.ggplot2.org/0.9.2.1/stat_ecdf.html http://docs.ggplot2.org/0.9.2.1/stat_ecdf.html
- sesqu 14y agoThe problem with the ECDF is that it's harder to get a feel for, being cumulative. I spent a few days once playing with N-bin histograms, and still feel those should be the default (with non-compact ends, maybe gamma distributed) over smoothed hacks.