MosaicPlot.CreateWithFreq

Prototypes

static MosaicPlot CreateWithFreq( DataObject dobj, Matrix mXVarNames, String sYVarName, String sFreqVarName <, boolean bShow> )

static MosaicPlot CreateWithFreq( String sDataName, Matrix mX, Matrix mY, Matrix mFreq <, boolean bShow> )

Return Value

The return value is a reference to the newly created MosaicPlot object.

Parameters

DataObject dobj
The DataObject containing the variables you want to plot.

Matrix mXVarNames
A vector containing the names of the variables to assign to the X axis.

String sYVarName
The name of the variable to assign to the Y axis.

String sFreqVarName
The name of the variable you want to use as the frequency variable. The ith value of this variable specifies the number of times the ith observation is counted.

boolean bShow
If bShow is true, the plot's window is displayed. If bShow is false, the plot's window is hidden. Calling this method without specifying bShow is equivalent to calling it with bShow equal to true.

String sDataName
The name to assign to the DataObject created internally by this method.

Matrix mX
A matrix containing data for the X axis. The values in each column define a grouping of the data in the mY matrix. The mX matrix is used to create a DataObject and then that DataObject is used to create a MosaicPlot.

Matrix mY
A vector containing data for the Y axis. This vector is added to the same DataObject as the mX vector.

Matrix mFreq
A numeric vector specifying the frequency of each observation. The integer part of mFreq[i] represents the number of times the ith observation is counted. This vector is added to the same DataObject as the mX vector.

Remarks

This method creates a mosaic plot from data that includes a frequency variable.

Frequency values are treated as counts. Only the integer part of each frequency value is used. If an observation has a frequency value that is missing or less than one, it is not used.

Example
vehicle = { "car", "car", "truck", "truck", "van", "van" };
age     = { "new", "old", "new",   "old",   "new", "old" };
freq    = {  3,     1,     2,       5,       1,     2    };
declare DataObject dobj = DataObject.Create( "Vehicles" );
dobj.AddVar( "vehicle", "Vehicle", vehicle );
dobj.AddVar( "age", "Age", age );
dobj.AddVar( "freq", "Frequency", freq );
declare MosaicPlot plot;
plot = MosaicPlot.CreateWithFreq( dobj, "vehicle", "age", "freq" );
plot.ShowTileLabels();
See Also

MosaicPlot.Create