Solved – How to statistically compare groups for multiple density plots

chi-squared-testdensity functiondistributionshypothesis testingr

Is there a statistical method to compare these density plots other than ANOVA (MANOVA)? I would like to compare the densities among year within each plot and report which of those distributions are "significantly different". The reason is that I am more interested in the spread and where on the distribution of the dataset rather than solely on the mean and variance. Thanks

Here is the code and plot

ggplot(NMPSCFAM, aes(Length, colour= Year)) + 
  geom_density(aes(y = ..count..), alpha=0.3) + xlim(0, 700) +  
  geom_density(aes(colour = Year)) +
  xlab("") +
  ylab(expression(paste("Mean density ( ", m^2, ")", sep = ""))) +
facet_wrap( ~ Family + Sector2, ncol=3, scales = "free")

enter image description here


Edit: Ok so no answers so far. If I did these density plots in a histogram would there be a way to do a Chi-square test on each of the plots? Could any one help me out on how to do this in R?

Best Answer

The problem with a chi-square is it ignores the ordering, leading to a loss of power.

One possibility: there is a k-group version of a Kolmogorov-Smirnov test$^{[1]}$.

Another is a k-sample Anderson-Darling test. E.g. see Wikipedia.

A third possibility might be to look at an orthogonal-polynomial decomposition of a chi-square (or rather the first few terms in one), which would then be taking account of the ordering. See, for example chapter 6 of Best (1999)$^{[2]}$.

[1]: Conover, W. J. (1965),
"Several k-Sample Kolmogorov-Smirnov Tests",
The Annals of Mathematical Statistics, 36:3 (Jun.), pp. 1019-1026

[2]: Best, D.J. (1999),
Tests of fit and other nonparametric data analysis,
PhD Thesis, School of Mathematics and Applied Statistics, University of Wollongong
http://ro.uow.edu.au/theses/2061 (direct link)

Related Question