plotAddEllipses {MorphoTools2} | R Documentation |
Add Prediction Ellipses to a Plot
Description
This function draws prediction ellipses around taxa.
Usage
plotAddEllipses(result, axes = c(1,2), probability = 0.95, col = "black",
type = "l", lty = 1, lwd = 1, ...)
Arguments
result |
result of |
axes |
x, y axes of plot. |
probability |
probability, that a new independent observation from the same population will fall in that ellipse. |
col |
the colours for labels. |
type |
character indicating the type of plotting, for details, see |
lty |
the line type. Line types can either be specified as one of following types: |
lwd |
the line width. |
... |
further arguments to be passed to |
Details
Prediction ellipses with given probability
define the regions where will fall any new independent observation from the respective taxa. The prediction ellipses are quantified using covariance matrices of taxa scores and chi-squared distribution with two degrees of freedom (Friendly et al. 2013).
Value
None. Used for its side effect of adding elements to a plot.
References
Friendly M., Monette G., Fox J. (2013). Elliptical insights: understanding statistical methods through elliptical geometry. Statistical Science 28, 1-39.
Examples
data(centaurea)
centaurea = naMeanSubst(centaurea)
centaurea = removePopulation(centaurea, populationName = c("LIP", "PREL"))
pcaRes = pca.calc(centaurea)
plotPoints(pcaRes, col = c(rgb(255, 0, 0, max = 255, alpha = 150), # red
rgb(0, 255, 0, max = 255, alpha = 150), # green
rgb(0, 0, 255, max = 255, alpha = 150), # blue
rgb(0, 0, 0, max = 255, alpha = 150)), # black
legend = FALSE, xlim = c(-5, 7.5), ylim = c(-5, 5.5))
plotAddLegend(pcaRes, col = c("red", "green", "blue", "black"), ncol = 2)
plotAddEllipses(pcaRes, col = c("red", "green", "blue", "black"), lwd = 3)