[R-sig-eco] Package 'compositions'; Function dnorm.acomp()

Rich Shepard rshepard at appl-ecosys.com
Tue Sep 30 18:45:20 CEST 2014


   For a data set of count proportions, testing for fit to a multivariate
normal distribution is done with the function dnorm.acomp() in package
'compositions'. The function's calling parameters are the data set, mean,
and variance.

   Example data set:

>dput(win.acomp)
structure(c(0.0667, 0.0612061206120612, 0.0435, 0.044, 0.05, 
0.0161, 0.6, 0.571457145714572, 0.6232, 0.5934, 0.4333, 0.629, 
0.0667, 0.0612061206120612, 0.1014, 0.0659, 0.0667, 0.0323, 0.2444, 
0.265326532653265, 0.2174, 0.2637, 0.3667, 0.2903, 0.0222, 0.0408040804080408, 
0.0145, 0.033, 0.0833, 0.0323), .Dim = c(6L, 5L), .Dimnames = list(
     NULL, c("Filterer", "Gatherer", "Grazer", "Predator", "Shredder"
     )), class = "acomp")

   The mean() function returns the mean value for each column:

> mean(win.acomp)
   Filterer   Gatherer     Grazer   Predator   Shredder
0.04386630 0.58270151 0.06366245 0.27664502 0.03312472

and the multivariate function, mvar(), returns a single value:

> mvar(win.acomp)
[1] 0.6309852

   The dnorm.acomp() syntax, according to ?dnorm.acomp has a single value for
the mean:

dnorm.acomp(x,mean,var)

which raises the question of which mean value do I use for a data set?

TIA,

Rich



More information about the R-sig-ecology mailing list