# [R] How to compare stacked histograms/datasets

Joshua Wiley jwiley.psych at gmail.com
Thu Jul 12 06:35:45 CEST 2012

```Hi,

Sure, you could do a qqplot for each variable between two datasets.
In a 2d graph, it will be hard to reasonably compare more than 2
datasets (you can put many such graphs on a single page, but it would
be pairwise sets of comparisons, I think.  Perhaps you could plots
multiple qqplots on top of each other varying the points by colour for
the different data sets?

I have not seen anything like this before, so I suppose it depends
what helps you understand your data.

Cheers,

Josh

On Sat, Jul 7, 2012 at 3:25 PM, Atulkakrana <atulkakrana at gmail.com> wrote:
> Hello Joshua,
>
> Thanks for taking time out to help me with problem. Actually the comparison
> is to be done among two (if possible, more than two) datasets and not within
> the dataset. Each dataset hold 5 variables (i.e Red, Purple, Blue, Grey and
> Yellow) for 21 different positions i.e 1-21n. So, we have 5 values for each
> position (total 21) that make a single dataset or stacked histogram (Plot in
> original post).
>
> Initially I was comparing datasets by plotting stacked histograms for each
> and analyzing them visually. But that doesn't give a statistical idea of how
> similar or different the datasets are. Therefore, I want to evaluate the
> datasets in order to quantify their difference/similarity. So, end result
> would be a plot showing similarity/difference among two or more datasets.
>
> Example datasets: http://pastebin.com/iYj1RNvt
>
> Does the method you explained can be applied to multiple datasets? Can a
> qqplot be obtained in such a case?
>
>
> Thanks
>
> Atul
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-compare-stacked-histograms-datasets-tp4635668p4635744.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> and provide commented, minimal, self-contained, reproducible code.

--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

```