gov.sandia.cognition.statistics.method
Class TukeyKramerConfidence.Statistic

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.method.AbstractMultipleHypothesisComparison.Statistic
          extended by gov.sandia.cognition.statistics.method.TukeyKramerConfidence.Statistic
All Implemented Interfaces:
MultipleHypothesisComparison.Statistic, CloneableSerializable, Serializable, Cloneable
Enclosing class:
TukeyKramerConfidence

public static class TukeyKramerConfidence.Statistic
extends AbstractMultipleHypothesisComparison.Statistic

Statistic from Tukey-Kramer's multiple comparison test

See Also:
Serialized Form

Field Summary
protected  Matrix standardErrors
          Gets the standard errors in the experiment
protected  ArrayList<Integer> subjectCounts
          Number of subjects in each treatment
protected  double totalVariance
          Variance over all subjects in the experiment
protected  ArrayList<Double> treatmentMeans
          Mean for each treatment
 
Fields inherited from class gov.sandia.cognition.statistics.method.AbstractMultipleHypothesisComparison.Statistic
nullHypothesisProbabilities, testStatistics, treatmentCount, uncompensatedAlpha
 
Constructor Summary
TukeyKramerConfidence.Statistic(double uncompensatedAlpha, ArrayList<Integer> subjectCounts, ArrayList<Double> treatmentMeans, double totalVariance)
          Creates a new instance of StudentizedMultipleComparisonStatistic
 
Method Summary
 boolean acceptNullHypothesis(int i, int j)
          Determines if the (i,j) null hypothesis should be accepted (true) or rejected (false) .
 TukeyKramerConfidence.Statistic clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
protected  Matrix computeNullHypothesisProbabilities(ArrayList<Integer> subjectCounts, Matrix Z)
          Computes null-hypothesis probability for the (i,j) treatment comparison
 Matrix computeTestStatistics(ArrayList<Integer> subjectCounts, ArrayList<Double> treatmentMeans, double totalVariance)
          Computes the test statistic for all treatments
 Matrix getStandardErrors()
          Getter for standardErrors
 ArrayList<Integer> getSubjectCounts()
          Getter for subjectCounts
 double getTotalVariance()
          Getter for totalVariance
 ArrayList<Double> getTreatmentMeans()
          Getter for treatmentMeans
 
Methods inherited from class gov.sandia.cognition.statistics.method.AbstractMultipleHypothesisComparison.Statistic
getNullHypothesisProbability, getTestStatistic, getTreatmentCount, getUncompensatedAlpha, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subjectCounts

protected ArrayList<Integer> subjectCounts
Number of subjects in each treatment


treatmentMeans

protected ArrayList<Double> treatmentMeans
Mean for each treatment


totalVariance

protected double totalVariance
Variance over all subjects in the experiment


standardErrors

protected Matrix standardErrors
Gets the standard errors in the experiment

Constructor Detail

TukeyKramerConfidence.Statistic

public TukeyKramerConfidence.Statistic(double uncompensatedAlpha,
                                       ArrayList<Integer> subjectCounts,
                                       ArrayList<Double> treatmentMeans,
                                       double totalVariance)
Creates a new instance of StudentizedMultipleComparisonStatistic

Parameters:
uncompensatedAlpha - Uncompensated alpha (p-value threshold) for the multiple comparison test
subjectCounts - Number of subjects in each treatment
treatmentMeans - Mean for each treatment
totalVariance - Variance over all subjects in the experiment
Method Detail

computeTestStatistics

public Matrix computeTestStatistics(ArrayList<Integer> subjectCounts,
                                    ArrayList<Double> treatmentMeans,
                                    double totalVariance)
Computes the test statistic for all treatments

Parameters:
subjectCounts - Number of subjects in each treatment
treatmentMeans - Mean for each treatment
totalVariance - Variance over all subjects in the experiment
Returns:
Test statistics, where the (i,j) element compares treatment "i" to treatment "j", the statistic is symmetric

computeNullHypothesisProbabilities

protected Matrix computeNullHypothesisProbabilities(ArrayList<Integer> subjectCounts,
                                                    Matrix Z)
Computes null-hypothesis probability for the (i,j) treatment comparison

Parameters:
subjectCounts - Number of subjects in the experiment
Z - Test statistic for the (i,j) treatment comparison
Returns:
Null-hypothesis probability for the (i,j) treatment comparison

clone

public TukeyKramerConfidence.Statistic clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractMultipleHypothesisComparison.Statistic
Returns:
A clone of this object.

getSubjectCounts

public ArrayList<Integer> getSubjectCounts()
Getter for subjectCounts

Returns:
Number of subjects in the experiment

getTreatmentMeans

public ArrayList<Double> getTreatmentMeans()
Getter for treatmentMeans

Returns:
Mean for each treatment

getTotalVariance

public double getTotalVariance()
Getter for totalVariance

Returns:
Variance over all subjects in the experiment

acceptNullHypothesis

public boolean acceptNullHypothesis(int i,
                                    int j)
Description copied from interface: MultipleHypothesisComparison.Statistic
Determines if the (i,j) null hypothesis should be accepted (true) or rejected (false) . Rejecting a null hypothesis typically means that there is a significant difference between the (i,j) treatment.

Parameters:
i - First treatment index
j - Second treatment index
Returns:
True if we accept the null hypothesis, false if we reject the null hypothesis

getStandardErrors

public Matrix getStandardErrors()
Getter for standardErrors

Returns:
Gets the standard errors in the experiment