BoxPlot.CreateWithFreq

Prototypes

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

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

Return Value

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

Parameters

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

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

String sYVarName
The name of the variable you want 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 frequency of the ith value of the Y variable.

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 whose columns determine the groups used to produce the boxes in the plot. This matrix is added to the same DataObject as the mY vector.

Matrix mY
A numeric vector containing coordinate data for the Y axis. This vector is used to create a DataObject and then that DataObject is used to create a BoxPlot.

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

Remarks

This method creates a box 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
gender = { M  F  F  M  F  M  M  F  M  F  M  M  F  F  F  M };
height = { 52 53 54 54 56 56 57 58 58 59 59 60 61 62 63 64 };
freq   = { 1  1  1  1  1  1  1  2  2  2  2  1  1  1  1  1 };
declare DataObject dobj = DataObject.Create( "Student Height" );
dobj.AddVar( "Gender", "Gender", gender );
dobj.AddVar( "Height", "Height", height );
dobj.AddVar( "Freq", "Frequency", freq );
BoxPlot.CreateWithFreq( dobj, "Gender", "Height", "Freq" );
See Also

BoxPlot.Create