JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class Sample

java.lang.Object
  extended bygov.nasa.alsUtility.Sample
All Implemented Interfaces:
java.io.Serializable

public class Sample
extends java.lang.Object
implements java.io.Serializable

holds doubles (called "datums") from a statistical sample and does simple statistics on them

See Also:
Serialized Form

Field Summary
protected  java.util.Vector data
           
protected  double mean
           
protected  DoubleInterval range
           
protected  double standardDeviation
           
protected  boolean statisticsCorrect
           
protected  double variance
           
 
Constructor Summary
Sample()
           
 
Method Summary
 void addDatum(double d)
          add datum d to the sample
 void calculate()
          calculate (if necessary) and cache all statistics
 double datum(int i)
           
 double getDatum(int i)
           
static java.lang.String getHeaderString()
           
 double getHigh()
           
 double getLow()
           
 double getMean()
           
 int getN()
           
 double getRange()
           
 double getStandardDeviation()
           
 double getVariance()
           
 void normalize(double by)
          divides every value with by
 java.lang.String statisticsString()
           
static java.lang.String toString(Sample[] array)
           
static java.lang.String toString(Sample[][] array)
           
 boolean valid()
          is there enough data to calculate descriptive statistics?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.Vector data

statisticsCorrect

protected boolean statisticsCorrect

mean

protected double mean

variance

protected double variance

standardDeviation

protected double standardDeviation

range

protected DoubleInterval range
Constructor Detail

Sample

public Sample()
Method Detail

addDatum

public void addDatum(double d)
add datum d to the sample


getDatum

public double getDatum(int i)
Returns:
the ith datum

datum

public double datum(int i)
Returns:
the ith datum

normalize

public void normalize(double by)
divides every value with by

Parameters:
by - value to divide every datum with

valid

public boolean valid()
is there enough data to calculate descriptive statistics?


statisticsString

public java.lang.String statisticsString()
Returns:
statistics in tab separated format

getHeaderString

public static java.lang.String getHeaderString()

toString

public static java.lang.String toString(Sample[] array)

toString

public static java.lang.String toString(Sample[][] array)

calculate

public void calculate()
calculate (if necessary) and cache all statistics


getN

public int getN()
Returns:
number of datums

getMean

public double getMean()

getStandardDeviation

public double getStandardDeviation()

getVariance

public double getVariance()

getRange

public double getRange()

getLow

public double getLow()

getHigh

public double getHigh()

JavaGenes, NASA Ames. Written largely by Al Globus