StatBean Name: SampleStatisticsTable

Purpose: Displays summary statistics for the data in one or more numeric columns.

DataSource: SampleStatistics.


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
coefficientOfVariationbooleanWhether to display the coefficient of variation.true,falsefalse
geometricMeanbooleanWhether to display the sample geomtric mean.true,falsefalse
interquartileRangebooleanWhether to display the interquartile range.true,falsefalse
kurtosisbooleanWhether to display the sample kurtosis.true,falsefalse
lowerQuartilebooleanWhether to display the lower quartile.true,falsefalse
maximumbooleanWhether to display the sample maximum.true,falsetrue
meanbooleanWhether to display the sample mean.true,falsetrue
medianbooleanWhether to display the sample median.true,falsefalse
minimumbooleanWhether to display the sample minimum.true,falsetrue
modebooleanWhether to display the sample mode.true,falsefalse
rangebooleanWhether to display the sample range.true,falsefalse
sampleSizebooleanWhether to display the sample size.true,falsetrue
showColumnNamesbooleanWhether to include column names at the top of the table.true,falsetrue
skewnessbooleanWhether to display the sample skewness.true,falsefalse
standardDeviationbooleanWhether to display the sample standard deviation.true,falsetrue
standardErrorbooleanWhether to display the standard error of the mean.true,falsefalse
standardizedSkewnessbooleanWhether to display the standardized skewness.true,falsefalse
standardizedKurtosisbooleanWhether to display the standardized kurtosis.true,falsefalse
totalbooleanWhether to display the sample sum.true,falsefalse
upperQuartilebooleanWhether to display the upper quartile.true,falsefalse
variancebooleanWhether to display the sample variance.true,falsefalse

Other properties are inherited from the java.awt.Panel class and from the general TabularStatbean class.

Code Sample

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

//set the file name
fileDataSource1.setFileName("c:\\statbeans\\samples\\cardata.txt");

//create a samplestatistics bean
sampleStatistics1 = new STATBEANS.SampleStatistics();

//set the column names for computing statistics
java.lang.String[] tempString = new java.lang.String[3];
tempString[0] = new java.lang.String("mpg");
tempString[1] = new java.lang.String("weight");
tempString[2] = new java.lang.String("horsepower");
sampleStatistics1.setColumnNames(tempString);

//create a table bean
sampleStatisticsTable1 = new STATBEANS.SampleStatisticsTable();

//define any non-default statistics to be included in the table
sampleStatisticsTable1.setMedian(true);
sampleStatisticsTable1.setVariance(true);
sampleStatisticsTable1.setKurtosis(true);
sampleStatisticsTable1.setCoefficientOfVariation(true);
sampleStatisticsTable1.setRange(true);
sampleStatisticsTable1.setMode(true);
sampleStatisticsTable1.setSkewness(true);

//add the table to the display panel
add(sampleStatisticsTable1);

//register the calculation StatBean as a listener to the datasource
fileDataSource1.addDataChangeListener(sampleStatistics1.listenerForDataChange;

//register the table StatBean as a listener to the calculation StatBean
sampleStatistics1.addDataChangeListener(sampleStatisticsTable1.listenerForDataChange);

//read the file
fileDataSource1.readData();

//notify all listeners
fileDataSource1.updateListeners();