[R-sig-eco] Multivariate dispersion and SE

Emma EG. Gothe Emma.Gothe at vatten.slu.se
Wed Jun 2 13:39:58 CEST 2010


Etienne, 

Thank you so much for your help.
I have managed to get the values I wanted after your advice!

Best 
/Emma
_______________________________________

Emma Göthe, PhD-student

Department of Aquatic Sciences and Assessment
Swedish University of Agricultural Sciences
Box 7050
750 07 Uppsala

Tel: +46-(0)18-673138
Fax: +46-(0)18-673156
E-mail: emma.gothe at vatten.slu.se
________________________________________
Från: Etienne Laliberté [etiennelaliberte at gmail.com]
Skickat: den 1 juni 2010 21:22
Till: Emma EG. Gothe
Kopia: r-sig-ecology at r-project.org
Ämne: Re: [R-sig-eco] Multivariate dispersion and SE

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