diff --git a/README.Rmd b/README.Rmd index 1483ea5..af3d744 100644 --- a/README.Rmd +++ b/README.Rmd @@ -222,6 +222,8 @@ iris.mod <- lm(cbind(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) ~ heplot(iris.mod) ``` +### Contrasts + Contrasts or other linear hypotheses can be shown as well, and the ellipses look better if they are filled. We create contrasts to test the differences between `versacolor` and `virginca` and also between @@ -246,7 +248,9 @@ heplot(iris.mod, hypotheses=hyp, fill=TRUE, fill.alpha=0.1) ``` -All pairwise HE plots are produced using the `pairs` method for MLM +### All pairwise HE plots + +All pairwise HE plots are produced using the `pairs()` method for MLM objects. ```{r, iris3, out.width="100%"} @@ -254,6 +258,20 @@ pairs(iris.mod, hypotheses=hyp, hyp.labels=FALSE, fill=TRUE, fill.alpha=0.1) ``` +### Covariance ellipses + +MANOVA relies on the assumption that within-group covariance matrices are all equal. +It is useful to visualize these in the space of some of the predictors. +`covEllipses()` provides this both for classical and robust estimates. +The figure below shows these for the three Iris species and the +pooled covariance matrix, which is the same as the **E** matrix used +in MANOVA tests. +```{r iris4, out.width="80%"} +covEllipses(iris[,1:4], iris$Species) +covEllipses(iris[,1:4], iris$Species, + fill=TRUE, method="mve", add=TRUE, labels="") +``` + ## References Anderson, E. (1928). The Problem of Species in the Northern Blue Flags, @@ -288,5 +306,5 @@ Linear Models in Psychological Research: An R Tutorial.](https://doi.org/10.20982/tqmp.13.1.p020) *The Quantitative Methods for Psychology*, **13**, 20-45. -Friendly, M. & Sigal, M. (2018): Visualizing Tests for Equality of -Covariance Matrices, _The American Statistician_, [DOI](https://doi.org/10.1080/00031305.2018.1497537) +Friendly, M. & Sigal, M. (2018): [Visualizing Tests for Equality of +Covariance Matrices](https://www.datavis.ca/papers/EqCov-TAS.pdf), _The American Statistician_, [DOI](https://doi.org/10.1080/00031305.2018.1497537) diff --git a/README.md b/README.md index e3f4e1f..4703f12 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,8 @@ heplot(iris.mod) +### Contrasts + Contrasts or other linear hypotheses can be shown as well, and the ellipses look better if they are filled. We create contrasts to test the differences between `versacolor` and `virginca` and also between @@ -232,7 +234,9 @@ heplot(iris.mod, hypotheses=hyp, -All pairwise HE plots are produced using the `pairs` method for MLM +### All pairwise HE plots + +All pairwise HE plots are produced using the `pairs()` method for MLM objects. ``` r @@ -242,6 +246,23 @@ pairs(iris.mod, hypotheses=hyp, hyp.labels=FALSE, +### Covariance ellipses + +MANOVA relies on the assumption that within-group covariance matrices +are all equal. It is useful to visualize these in the space of some of +the predictors. `covEllipses()` provides this both for classical and +robust estimates. The figure below shows these for the three Iris +species and the pooled covariance matrix, which is the same as the **E** +matrix used in MANOVA tests. + +``` r +covEllipses(iris[,1:4], iris$Species) +covEllipses(iris[,1:4], iris$Species, + fill=TRUE, method="mve", add=TRUE, labels="") +``` + + + ## References Anderson, E. (1928). The Problem of Species in the Northern Blue Flags, @@ -275,6 +296,7 @@ Linear Models in Psychological Research: An R Tutorial.](https://doi.org/10.20982/tqmp.13.1.p020) *The Quantitative Methods for Psychology*, **13**, 20-45. -Friendly, M. & Sigal, M. (2018): Visualizing Tests for Equality of -Covariance Matrices, *The American Statistician*, +Friendly, M. & Sigal, M. (2018): [Visualizing Tests for Equality of +Covariance Matrices](https://www.datavis.ca/papers/EqCov-TAS.pdf), *The +American Statistician*, [DOI](https://doi.org/10.1080/00031305.2018.1497537) diff --git a/docs/index.html b/docs/index.html index 861d7ef..ec3dfd0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -416,6 +416,9 @@
Contrasts or other linear hypotheses can be shown as well, and the ellipses look better if they are filled. We create contrasts to test the differences between versacolor
and virginca
and also between setosa
and the average of the other two. Each 1 df contrast plots as degenerate 1D ellipse– a line.
Because these contrasts are orthogonal, they add to the total 2 df effect of Species
. Note how the first contrast, labeled V:V
, distinguishes the means of versicolor from virginica; the second contrast, S:VV
distinguishes setosa
from the other two.
@@ -434,12 +437,27 @@Examplesheplot(iris.mod, hypotheses=hyp, fill=TRUE, fill.alpha=0.1)
All pairwise HE plots are produced using the pairs
method for MLM objects.
All pairwise HE plots are produced using the pairs()
method for MLM objects.
pairs(iris.mod, hypotheses=hyp, hyp.labels=FALSE,
fill=TRUE, fill.alpha=0.1)
MANOVA relies on the assumption that within-group covariance matrices are all equal. It is useful to visualize these in the space of some of the predictors. covEllipses()
provides this both for classical and robust estimates. The figure below shows these for the three Iris species and the pooled covariance matrix, which is the same as the E matrix used in MANOVA tests.
+covEllipses(iris[,1:4], iris$Species)
+covEllipses(iris[,1:4], iris$Species,
+ fill=TRUE, method="mve", add=TRUE, labels="")
Friendly, M.; Monette, G. & Fox, J. (2013). Elliptical Insights: Understanding Statistical Methods Through Elliptical Geometry Statistical Science, 28, 1-39.
Friendly, M. & Sigal, M. (2017). Graphical Methods for Multivariate Linear Models in Psychological Research: An R Tutorial. The Quantitative Methods for Psychology, 13, 20-45.
-Friendly, M. & Sigal, M. (2018): Visualizing Tests for Equality of Covariance Matrices, The American Statistician, DOI
+Friendly, M. & Sigal, M. (2018): Visualizing Tests for Equality of Covariance Matrices, The American Statistician, DOI