Skip to content
Prev 77637 / 398502 Next

Multiple density plots on 1 graph

Emma:

1. I don't know what you mean by "empirical density of the data." I'm pretty
sure that overlaying 50, say, kernel density estimators (with the same
kernels?) would produce a completely useless mess. Ditto, I would think, for
anything that looks something like a kernel density (histograms, frequency
polygons, etc.).

2. You might be able to see something using empirical cumulative
distribution functions (?ecdf), so I suggest you consider that instead.

3. Better yet, as was suggested by Max Kuhn, try lattice plots of ecdf's (or
possibly kernel density estimators) with the lattice arrangement determined
by factors of interest or ordered by some useful summary statistic (e.g.
median) of the distributions. Or perhaps use qqmath if the data come from
some known distributional form (Gaussian, gamma, ...). Ordering the lattice
plots in an informative way can reveal a great deal more.

4. Thinking more carefully about what you want to show and what you want to
learn from these plots should help you decide what to do. Then you can use R
to do it (usually easily).


-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box