static Histogram CreateWithFreq( DataObject dobj, String sXVarName, String sFreqVarName <, boolean bShow> )
static Histogram CreateWithFreq( String sDataName, Matrix mX, Matrix mFreq <, boolean bShow> )
The return value is a reference to the newly created Histogram object.
DataObject dobj
The DataObject containing the variables you want to plot.
String sXVarName
The name of the variable you want to assign to the X 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 X 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 numeric vector containing the data you want to plot. This vector is used to create a DataObject and then that DataObject is used to create a Histogram.
Matrix mFreq
A numeric vector specifying the frequency of each value in mX. The integer part of mFreq[i] represents the number of times the value mX[i]
is counted. This vector is added to the same DataObject as the mX vector.
This method creates a histogram 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.
height = T({ 52 53 54 56 57 58 59 60 61 62 63 64 }); freq = { 1 1 2 2 1 4 4 1 1 1 1 1 }; declare DataObject dobj; dobj = DataObject.Create( "Student Height", "Height", height ); dobj.AddVar( "Freq", freq ); Histogram.CreateWithFreq( dobj, "Height", "Freq" );