---
title: Statistical Sampling Tool | Sample Test Statistic Calculator
description: Compute sample statistics for data with this statistical sampling tool from Statgraphics. Learn about this useful sample test statistic calculator here.
---

[![Statgraphics 19 logo](https://www.statgraphics.com/hs-fs/hubfs/stat19plain-01-1.png?width=2272&height=484&name=stat19plain-01-1.png "Statgraphics 19 logo")](https://www.statgraphics.com)

- [Products](https://www.statgraphics.com/product)
- [Learn](https://www.statgraphics.com/statistics-library)
- [Training](https://www.statgraphics.com/training-and-consulting)

- [Product](https://www.statgraphics.com/product) 
    - [Centurion XVIII](https://www.statgraphics.com/centurion-xvii)
    - [Sigma Express](https://www.statgraphics.com/statgraphics-sigma-express)
    - [Online](https://www.statgraphics.com/statgraphics-stratus)
    - [Web Services](https://www.statgraphics.com/statgraphics-web-services)
- [Learn](https://www.statgraphics.com/statistics-library) 
    - [Statistics Library](https://www.statgraphics.com/statistics-library)
    - [Six Sigma & Lean](https://www.statgraphics.com/six-sigma-lean)
    - [Instructional Videos](https://www.statgraphics.com/instructional-videos)
    - [Applications/ Case Studies](https://www.statgraphics.com/application)
- [Training & Consulting](https://www.statgraphics.com/training-and-consulting) 
    - [Statpoint Seminars](https://www.statgraphics.com/statpoint-seminar)
    - [Statpoint Instructors](https://www.statgraphics.com/statpoint-instructor)
    - [Training Partners](https://www.statgraphics.com/training-partners)
    - [Webinars](https://www.statgraphics.com/webinars)
- [Support](https://www.statgraphics.com/customer-support-overview)
- [Blog](https://www.statgraphics.com/blog)
- [Store](http://store.statgraphics.com)

### Statgraphics

## [Centurion](https://www.statgraphics.com/centurion-overview)

#### [LEARN MORE](https://www.statgraphics.com/centurion-overview)

### Statgraphics

## [Sigma *express*](https://www.statgraphics.com/statgraphics-sigma-express)

#### [LEARN MORE](https://www.statgraphics.com/statgraphics-sigma-express)

### Statgraphics

## [*Stratus*](https://www.statgraphics.com/statgraphics-stratus)

#### [LEARN MORE](https://www.statgraphics.com/statgraphics-stratus)

### Statgraphics

## [Web Services](https://www.statgraphics.com/statgraphics-web-services)

#### [LEARN MORE](https://www.statgraphics.com/statgraphics-web-services)

## [Statistics Library](https://www.statgraphics.com/statistics-library)

#### [LEARN MORE](https://www.statgraphics.com/statistics-library)

## [Six Sigma & Lean](https://www.statgraphics.com/six-sigma-lean)

#### [LEARN MORE](https://www.statgraphics.com/six-sigma-lean)

## [Instructional Videos](https://www.statgraphics.com/instructional-videos)

#### [LEARN MORE](https://www.statgraphics.com/instructional-videos)

## [Applications/ Case Studies](https://www.statgraphics.com/statistical-applications)

#### [LEARN MORE](https://www.statgraphics.com/statistical-applications)

## [Statgraphics Seminars](https://www.statgraphics.com/statpoint-seminar)

#### [LEARN MORE](https://www.statgraphics.com/statpoint-seminar)

## [Statgraphics Instructors](https://www.statgraphics.com/statpoint-instructor)

#### [LEARN MORE](https://www.statgraphics.com/statpoint-instructor)

## [Training Partners](https://www.statgraphics.com/public-seminar)

#### [LEARN MORE](https://www.statgraphics.com/public-seminar)

## [Webinars](https://www.statgraphics.com/webinars)

#### [LEARN MORE](https://www.statgraphics.com/webinars)

#### Statbeans

- [STATBEANS® Overview](https://www.statgraphics.com/statbeans)
- [DataSource STATBEANS®](https://www.statgraphics.com/statbeans_datasource)
- [Calculation STATBEANS®](https://www.statgraphics.com/statbeans_calculations)
- [Tabular STATBEANS®](https://www.statgraphics.com/statbeans_tabular)
- [Graphical STATBEANS®](https://www.statgraphics.com/statbeans_graphical)

[Back to Product Overviews](https://www.statgraphics.com/product)

<https://www.statgraphics.com/statbeans/calculations/sample_statistics#anchor3>

# Calculation STATBEANS®

 

**STATBEAN Name:** SampleStatistics

 

**Purpose:** Allows Statgraphics to function as a statistical sampling calculator. Computes sample statistics for the data in two or more numeric columns.

**DataSource for this sample test statistic calculator: **any. 

**Read/Write Properties**

| **Name** | **Type** | **Description** | **Possible Values** | **Default Value** |
| --- | --- | --- | --- | --- |
| columnNames | String array | The names of the columns to be analyzed. | One or more strings. | {""} |
| missingValueExclusion | String | The method for handling records which contain missing values. | "Columnwise","Casewise", "Tablewise" | "Columnwise" |

**Other Public Methods For the Sample Test Statistics Calculator**

| **Name** | **Description** | **Arguments** | **Return Value** |
| --- | --- | --- | --- |
| double getCoefficientOfVariation(int columnNumber) | Calculates the CV by dividing the sample standard deviation by the sample mean and multiplying by 100. | Column number (0 origin). | Coefficient of variation, or missingValueCode if n<1 or mean = 0. |
| double getGeometricMean(int columnNumber) | Calculates the geometric mean. | Column number (0 origin). | Sample geometric mean, or missingValueCode if n=0 or any data value is <= 0. |
| double getInterquartileRange(int columnNumber) | Calculates the sample interquartile range. | Column number (0 origin). | Interquartile range, or missingValueCode if n=0. |
| double getKurtosis(int columnNumber) | Calculates the sample kurtosis. | Column number (0 origin). | Sample skewness, or missingValueCode if n<4. |
| double getLowerQuartile(int columnNumber) | Calculates the lower quartile of the sample. | Column number (0 origin). | Lower quartile, or missingValueCode if n=0. |
| double getMaximum(int columnNumber) | Calculates the maximum value in the sample. | Column number (0 origin). | Sample maximum, or missingValueCode if n=0. |
| double getMean(int columnNumber) | Calculates the sample mean. | Column number (0 origin). | Sample mean, or missingValueCode if n=0. |
| double getMedian(int columnNumber) | Calculates the sample median. | Column number (0 origin). | Sample median, or missingValueCode if n=0. |
| double getMinimum(int columnNumber) | Calculates the miniumum value in the sample. | Column number (0 origin). | Sample minimum, or missingValueCode if n=0. |
| double getMode(int columnNumber) | Calculates the sample mode. | Column number (0 origin). | Sample mode, or missingValueCode if n=0 or no unique mode exists. |
| double getRange(int columnNumber) | Calculates the sample range. | Column number (0 origin). | Sample range, or missingValueCode if n=0. |
| double getSampleSize(int columnNumber) | Calculates the number of non-missing data values. | Column number (0 origin). | Sample size n. |
| double getSkewness(int columnNumber) | Calculates the sample skewness. | Column number (0 origin). | Sample skewness, or missingValueCode if n<3. |
| double getStandardDeviation(int columnNumber) | Calculates the sample standard deviation. | Column number (0 origin). | Sample standard deviation, or missingValueCode if n<2. |
| double getStandardError(int columnNumber) | Calculates the standard error of the mean. | Column number (0 origin). | Sample standard error, or missingValueCode if n<2. |
| double getStandardizedSkewness(int columnNumber) | Calculates the standardized skewness. | Column number (0 origin). | Standardized skewness, or missingValueCode if n<3. |
| double getStandardizedKurtosis(int columnNumber) | Calculates the standardized kurtosis. | Column number (0 origin). | Standardized kurtosis, or missingValueCode if n<4. |
| double getTotal(int columnNumber) | Calculates the sum of the data values. | Column number (0 origin). | Sample sum, or missingValueCode if n=0. |
| double getUpperQuartile(int columnNumber) | Calculates the uppper quartile of the sample. | Column number (0 origin). | Upper quartile, or missingValueCode if n=0. |
| double getVariance(int columnNumber) | Calculates the sample variance. | Column number (0 origin). | Sample variance, or missingValueCode if n<2. |

**Statistical Sampling Calculator Code Sample**

//create a ProgramDataSource bean   
ProgramDataSource programDataSource1 = new ProgramDataSource(); 

//create a SampleStatistics bean   
SampleStatistics sampleStatistics1 = new SampleStatistics(); 

//create a data table of 12 rows and 1 column   
programDataSource1.createDataTable(12,1,-32768.0); 

//assign a name to the first column   
programDataSource1.setColumnName(0,"Sales");   
programDataSource1.setColumnType(0,'N'); 

//fill in the data values   
for(int i=0; i<12; i++) programDataSource1.setDoubleValue(i,0,(double)(i+1)/12); 

//assign the column names for which statistics are desired   
java.lang.String\[\] tempString = new String\[1\];   
tempString\[0\] = "Sales";   
sampleStatistics1.setColumnNames(tempString); 

//make the sample statistics bean a listener for changes in the programDataSource bean   
programDataSource1.addDataChangeListener(sampleStatistics1.listenerForDataChange); 

//notify all listeners   
programDataSource1.updateListeners(); 

//retrieve the results   
double mean=sampleStatistics1.getMean(0);   
double sigma=sampleStatistics1.getStandardDeviation(0);   
double skewness=sampleStatistics1.getStandardizedSkewness(0);   
double kurtosis=sampleStatistics1.getStandardizedKurtosis(0); 

//display the results   
g.drawString("Sample Statistics for Sales",10,20);   
g.drawString(" Mean ="+Double.toString(mean),10,40);   
g.drawString(" Sigma ="+Double.toString(sigma),10,60);   
g.drawString(" Stnd. Skewness ="+Double.toString(skewness),10,80);   
g.drawString(" Stnd. Kurtosis ="+Double.toString(kurtosis),10,100); 

[![contact-icon](https://www.statgraphics.com/hs-fs/hubfs/stat19web/sales.png?width=50&name=sales.png "contact-icon.fw")](https://www.statgraphics.com/contact-us-dealers-global-partners)

### [CONTACT SALES](https://www.statgraphics.com/contact-us-dealers-global-partners)

Contact our Sales team today

[![youtube-icon.fw](https://www.statgraphics.com/hubfs/stat19web/watchr.png)](https://www.statgraphics.com/instructional-videos)

### [WATCH A VIDEO](https://www.statgraphics.com/instructional-videos)

Learn more about the many enhancements added to Version 19

[![download](https://www.statgraphics.com/hubfs/stat19web/downloadr.png)](https://www.statgraphics.com/download18)

### [DOWNLOAD TRIAL](https://www.statgraphics.com/download19)

Try Statgraphics 19 today for free!

[![eye icon](https://www.statgraphics.com/hubfs/stat19web/viewr.png)](https://www.statgraphics.com/download-brochure-0)

### [VIEW BROCHURE](https://www.statgraphics.com/download-brochure-0)

Discover Statgraphics 19 with our product brochure.

![contact us](https://www.statgraphics.com/hubfs/stat19web/contactr.png)

© 2025 Statgraphics Technologies, Inc.

The Plains, Virginia

[CONTACT US](https://www.statgraphics.com/contact-us-partner)

![Statgraphics download center](https://www.statgraphics.com/hs-fs/hubfs/stat19web/downloadcr.png?width=50&name=downloadcr.png)

Have you purchased Statgraphics Centurion or Sigma Express and need to download your copy?

[CLICK HERE](https://www.statgraphics.com/download-center)

- [Support](https://www.statgraphics.com/customer-support-overview)
- [Company](https://www.statgraphics.com/contact-us-dealers-global-partners)
- [Blog](https://blog.statgraphics.com)

-  
-          

-  