Main Content

manovacluster

Dendrogram of group mean clusters following MANOVA

Description

manovacluster(stats) generates a dendrogram plot of the group means after a one-way multivariate analysis of variance (MANOVA). stats is a structure containing statistics returned by the manova1 function. manovacluster computes the clusters by applying the single linkage algorithm to the matrix of Mahalanobis distances between group means.

See dendrogram for more information on the graphical output from this function. The dendrogram is most useful when the number of groups is large.

example

manovacluster(stats,Linkage) specifies to use the Linkage algorithm for computing the distance between clusters.

manovacluster(ax,___) plots into the axes specified by ax instead of the current axes (gca) using any of the input argument combinations in the previous syntaxes. (since R2024a)

h = manovacluster(___) additionally returns handles to the plot elements in h, using any of the input argument combinations in the previous syntaxes.

Examples

collapse all

Load the sample data.

load carbig

Define the variable matrix.

X = [MPG Acceleration Weight Displacement];

Perform one-way MANOVA to compare the means of MPG, Acceleration, Weight, and Displacement grouped by Origin.

[d,p,stats] = manova1(X,Origin);

Create a dendrogram plot of the group means.

manovacluster(stats)

Figure contains an axes object. The axes object contains 6 objects of type line.

Input Arguments

collapse all

MANOVA statistics, specified as a structure returned by the manova1 function.

Data Types: struct

Algorithm for computing the distance between clusters, specified as a value in the following table.

AlgorithmDescription
"average"

Average distance

"centroid"

Centroid distance

"complete"

Farthest distance

"single" (default)

Shortest distance

"ward"

Inner squared distance (minimum variance algorithm)

For more information, see Linkages.

Data Types: char | string

Axes for the plot, specified as an Axes object. If you do not specify ax, then manovacluster creates the plot using the current axes. For more information on creating an Axes object, see axes.

Output Arguments

collapse all

Handles to the plot elements, returned as a handle array.

Version History

Introduced before R2006a

expand all