Skip to Main Content Skip to Search
Product Documentation

maineffectsplot - Main effects plot for grouped data

Syntax

maineffectsplot(Y,GROUP)
maineffectsplot(Y,GROUP,param1,val1,param2,val2,...)
[figh,AXESH] = maineffectsplot(...)

Description

maineffectsplot(Y,GROUP) displays main effects plots for the group means of matrix Y with groups defined by entries in the cell array GROUP. Y is a numeric matrix or vector. If Y is a matrix, the rows represent different observations and the columns represent replications of each observation. 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 rows as Y. The number of grouping variables must be greater than 1.

The display has one subplot per grouping variable, with each subplot showing the group means of Y as a function of one grouping variable.

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

[figh,AXESH] = maineffectsplot(...) returns the handle figh to the figure window and an array of handles AXESH to the subplot axes.

Examples

Display main effects plots for car weight with two grouping variables, model year and number of cylinders:

load carsmall;
maineffectsplot(Weight,{Model_Year,Cylinders}, ...
               'varnames',{'Model Year','# of Cylinders'})

See Also

interactionplot | multivarichart

How To

  


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