[R-sig-eco] Multivariate dispersion and SE

Etienne Laliberté etiennelaliberte at gmail.com
Tue Jun 1 21:22:51 CEST 2010


Emma,

betadisper returns a list, from which you can extract the individual
distances to group centroids. You can then compute whatever you want
from them (means, variances, etc).

Example:

data(varespec)

## Bray-Curtis distances between samples
dis <- vegdist(varespec)

## First 16 sites grazed, remaining 8 sites ungrazed
groups <- factor(c(rep(1,16), rep(2,8)), labels =
c("grazed","ungrazed"))

## Calculate multivariate dispersions
mod <- betadisper(dis, groups)
mod

## Compute mean distance to centroid per group
tapply(mod$distances, groups, mean)

## Same, but variance instead
tapply(mod$distances, groups, var)

Cheers

Etienne

Le mardi 01 juin 2010 à 14:25 +0200, Emma EG. Gothe a écrit :
> Dear All,
> 
> I am trying to calculate values of SE from an analysis of multivariate homogeneity of groups dispersions (betadisper {vegan})?
> 
> With function betadisper() I get values of the average distance to centroid/group and it is also possible to draw a boxplot with function boxplot() with variance information but I cant find a way to tell R to caclulate SE.
> 
> I realise it is possible to calulate (by hand) from the formula for the distance from a point to its centroid:
> 
> z[ij]^c = sqrt(Delta^2(u[ij]^+, c[i]^+) - Delta^2(u[ij]^-, c[i]^-))
> 
> given in the R documentation, by using the scores of the different points and centroids that can be obtained by using function scores (). But before I go there I thought Id ask if there is an easier way to obtain the variance information (in my case SE).
> 
> I am greatful for any help/advice I can get.
> 
> /Emma
> _______________________________________
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


-- 
Etienne Laliberté
================================
School of Forestry
University of Canterbury
Private Bag 4800
Christchurch 8140, New Zealand
Phone: +64 3 366 7001 ext. 8365
Fax: +64 3 364 2124
www.elaliberte.info



More information about the R-sig-ecology mailing list