StatBean Name: StemLeafDisplay

Purpose: Creates a stem-and-leaf display for a single column of numeric data.

DataSource: Any.


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
depthCountsbooleanWhether to add depth counts on the left of the plot.true,falsetrue
flagOutsidePointsbooleanWhether to add Hi and LO stems showing values unusually far from the others.true,falsetrue
maximumLeavesOnStemintMaximum leaves before adding "...".1+70
maximumStemsintMaximum number of stems in plot.1+15
minimumStemsintMinimum number of stems in plot.1+10
tablewiseExclusionbooleanWhether all rows of the data table containing a missing value in any column should be excluded from the plot.true,falsefalse
xVariableNameStringThe name of the column with data values to be plotted on the horizontal axis.Any string."X"

Other Public Methods
NameDescriptionArgumentsReturn Value
int getNumberFarOutside()Returns the number of far outside points.None.Number of data values more than 3.0 times the interquartile range from the box.
int getNumberOutside()Returns the number of outside points.None.Number of data values more than 1.5 times the interquartile range from the box.
int getNumberOfStems()Returns the number of stems.None.Number of stems.


Code Sample

//create a datasource bean
FileDataSource fileDataSource1 = new STATBEANS.FileDataSource();

//set the file name to be read
fileDataSource1.setFileName("c:\\statbeans\\samples\\spc.txt");

//create a table bean
StemLeafDisplay stemleafdisplay1 = new STATBEANS.StemLeafDisplay();

//set the column to be tabulated
stemleafdisplay1.setXVariableName("strength");

//set the number of stems
stemleafdisplay1.setMinimumStems(5);
stemleafdisplay1.setMaximumStems(10);

//add the table to the application frame
add(stemleafdisplay1);

//make the table bean a listener
fileDataSource1.addDataChangeListener(stemleafdisplay1.listenerForDataChange);

//instruct the fileDataSource bean to read the file
fileDataSource1.readData();