Skip to Main Content Skip to Search
Product Documentation

multivarichart - Multivari chart for grouped data

Syntax

multivarichart(y,GROUP)
multivarichart(Y)
multivarichart(...,param1,val1,param2,val2,...)
[charthandle,AXESH] = multivarichart(...)

Description

multivarichart(y,GROUP) displays the multivari chart for the vector y grouped by entries in the cell array GROUP. Each cell of GROUP must contain a grouping variable that can be a categorical variable, numeric vector, character matrix, or single-column cell array of strings. (See Grouped Data.) GROUP can also be a matrix whose columns represent different grouping variables. Each grouping variable must have the same number of elements as y. The number of grouping variables must be 2, 3, or 4.

Each subplot of the plot matrix contains a multivari chart for the first and second grouping variables. The x-axis in each subplot indicates values of the first grouping variable. The legend at the bottom of the figure window indicates values of the second grouping variable. The subplot at position (i,j) is the multivari chart for the subset of y at the ith level of the third grouping variable and the jth level of the fourth grouping variable. If the third or fourth grouping variable is absent, it is considered to have only one level.

multivarichart(Y) displays the multivari chart for a matrix Y. The data in different columns represent changes in one factor. The data in different rows represent changes in another factor.

multivarichart(...,param1,val1,param2,val2,...) specifies one or more of the following name/value pairs:

[charthandle,AXESH] = multivarichart(...) returns a handle charthandle to the figure window and a matrix AXESH of handles to the subplot axes.

Examples

Display a multivari chart for data with two grouping variables:

y = randn(100,1); % response
group = [ceil(3*rand(100,1)) ceil(2*rand(100,1))]; 
multivarichart(y,group)

Display a multivari chart for data with four grouping variables:

y = randn(1000,1); % response
group = {ceil(2*rand(1000,1)),ceil(3*rand(1000,1)), ...
         ceil(2*rand(1000,1)),ceil(3*rand(1000,1))};
multivarichart(y,group)

See Also

interactionplot | maineffectsplot

How To

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS