-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add veganCovEllipse() as an option to plot.betadisper() #166
Comments
Sure, should be relatively easy to implement. |
I've added an option to do this, though I'm not 100% convinced I have this right yet. If you have any comment or input, see PR #167 |
Closed via #167 |
The most recent version is now extremely nice. thanks for the work on this./ |
@gavinsimpson : When I look at the graph in the bottom of the heap, it seems that |
When I look at the plots on that page, it seems to me that the centers (group labels) are in the same positions in both the plot with hulls and that with ellipsoids. If you're referring to the fact that Ellipses may not be that useful for some distance metrics, but they certainly are for Euclidean distances. |
It's not about the metric (Euclidean or non-Euclidean), but it is about the way |
@friendly the problem is that I didn't plot the ellipsoid centre at all; the code just plots the So two options:
At the very least this should go in the |
I think there are two major-ish issues that should be solved:
|
I agree here, after a little thought, and have implemented both in my local branch. One question arises; do we still want to adjust the size of the sd ellipse or just leave it drawn at 1sd? I presume we could allow this sort of user-control via (suitably renamed) For future changes, I am looking into drawing a bag plot for the groups as that seems quite aligned with the goals of assessing bivariate distributions. |
I have no firm opinion for SD-multiplier. I could live without that and have a simpler UI and shorter man page with shorter list of arguments. About bag plots: the plot is bivariate, but it is only a bivariate shadow (well, projection) of n-dimensional space. The actual statistics (we report distances of points to centres) and tests work in n dimensions, but we only plot two in hope that this would show much of the real thing. BTW, it could be possible to add a plot with 3D ellipses in vegan3d. |
I'm sorry if I raised a can of worms here to cause you to debate all the possible options for All I can say, is that in my work on a current project concerning visualizing tests of covariance matrices in multivariate linear models, betadisper() was perfect for me to illustrate the dispersion approach stemming from Anderson, but the plot method, with convex hulls was unsuitable. Using a previous commit, #167, I could get what I wanted for one example via
This gave the plot below, that illustrated exactly what I wanted to show for this example. Here, it was important to me to show the 68% (~ \pm 1 bivariate sd) data ellipses and I didn't care how precisely they were centered, because the main thing was the sizes and shapes of the covariance ellipses. If you decide to eliminate this feature from Thanks once again for being responsive to requests by users. |
The intention of It is purely incidental that library(vegan)
dst <- dist(iris[,1:4])
iris.bd <- wcmdscale(dst, eig = TRUE) # PCoA
labs <- paste0("Dimension ", 1:4, " (",
round(100*iris.bd$eig / sum(iris.bd$eig), 2), "%)")
pl <- plot(iris.bd, main="Iris data: MDS coordinates", cex.lab=1.25,
xlab=labs[1], ylab=labs[2], type = "n")
points(pl, "sites", pch=as.numeric(iris$Species)+14, col=as.numeric(iris$Species))
ordispider(iris.bd, iris$Species, col=1:3) # col= usage needs vegan 2.4-0
ordiellipse(iris.bd, iris$Species, col=1:3, draw="poly", conf=0.68, label = TRUE) |
That is very helpful; thanks. BTW, |
You should thank @gavinsimpson for |
I've just merged changes from my I think this addresses the concerns about focussing too much on tests for location shifts whilst maintaining the idea of using a data ellipse rather than a convex hull. |
Hulls are useful for one type of display, but covariance (data) ellipses provided by
veganCovEllipse are also useful. It would not be hard to add this via an option
ellipse=T/F, as an alternative to hull=T/F
The text was updated successfully, but these errors were encountered: