gov.sandia.cognition.statistics.method
Class MultipleComparisonExperiment

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.method.MultipleComparisonExperiment
All Implemented Interfaces:
BlockExperimentComparison<Number>, MultipleHypothesisComparison<Collection<? extends Number>>, NullHypothesisEvaluator<Collection<? extends Number>>, CloneableSerializable, Serializable, Cloneable

public class MultipleComparisonExperiment
extends AbstractCloneableSerializable
implements BlockExperimentComparison<Number>, MultipleHypothesisComparison<Collection<? extends Number>>

A multiple comparisons experiment that does a block comparison and then a post-hoc test.

Since:
3.3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
static class MultipleComparisonExperiment.Statistic
          Result of running the MultipleHypothesisComparison hypothesis test
 
Field Summary
static double DEFAULT_ALPHA
          Default alpha (p-value threshold), 0.05.
static BlockExperimentComparison<Number> DEFAULT_BLOCK_EXPERIMENT_COMPARISON
          Default block-experiment comparison, FriedmanConfidence.
static MultipleHypothesisComparison<Collection<? extends Number>> DEFAULT_POST_HOC_TEST
          Default post-host multiple hypothesis comparison test, NemenyiConfidence.
 
Fields inherited from interface gov.sandia.cognition.statistics.method.MultipleHypothesisComparison
DEFAULT_UNCOMPENSATED_ALPHA
 
Constructor Summary
MultipleComparisonExperiment()
          Creates a new instance of MultipleComparisonExperiment
MultipleComparisonExperiment(BlockExperimentComparison<Number> blockExperimentComparison, MultipleHypothesisComparison<Collection<? extends Number>> postHocTest, double alpha)
          Creates a new instance of MultipleComparisonExperiment
 
Method Summary
 MultipleComparisonExperiment clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 MultipleComparisonExperiment.Statistic evaluateNullHypotheses(Collection<? extends Collection<? extends Number>> data)
          Evaluates the null hypotheses associated with the given collection of data.
 MultipleComparisonExperiment.Statistic evaluateNullHypotheses(Collection<? extends Collection<? extends Number>> data, double uncompensatedAlpha)
          Evaluates the null hypotheses associated with the given collection of data.
 MultipleComparisonExperiment.Statistic evaluateNullHypothesis(Collection<? extends Collection<? extends Number>> treatments)
          Evaluates the null hypothesis for the given block-design treatments
 MultipleComparisonExperiment.Statistic evaluateNullHypothesis(Collection<? extends Number> data1, Collection<? extends Number> data2)
          Computes the probability that two data were generated by the same distribution.
 double getAlpha()
          Getter for alpha
 BlockExperimentComparison<Number> getBlockExperimentComparison()
          Getter for blockExperimentComparison
 MultipleHypothesisComparison<Collection<? extends Number>> getPostHocTest()
          Getter for postHocTest
 void setAlpha(double alpha)
          Setter for alpha
 void setBlockExperimentComparison(BlockExperimentComparison<Number> blockExperimentComparison)
          Setter for blockExperimentComparison
 void setPostHocTest(MultipleHypothesisComparison<Collection<? extends Number>> postHocTest)
          Setter for postHocTest
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BLOCK_EXPERIMENT_COMPARISON

public static final BlockExperimentComparison<Number> DEFAULT_BLOCK_EXPERIMENT_COMPARISON
Default block-experiment comparison, FriedmanConfidence.


DEFAULT_POST_HOC_TEST

public static final MultipleHypothesisComparison<Collection<? extends Number>> DEFAULT_POST_HOC_TEST
Default post-host multiple hypothesis comparison test, NemenyiConfidence.


DEFAULT_ALPHA

public static final double DEFAULT_ALPHA
Default alpha (p-value threshold), 0.05.

See Also:
Constant Field Values
Constructor Detail

MultipleComparisonExperiment

public MultipleComparisonExperiment()
Creates a new instance of MultipleComparisonExperiment


MultipleComparisonExperiment

public MultipleComparisonExperiment(BlockExperimentComparison<Number> blockExperimentComparison,
                                    MultipleHypothesisComparison<Collection<? extends Number>> postHocTest,
                                    double alpha)
Creates a new instance of MultipleComparisonExperiment

Parameters:
blockExperimentComparison - Block-experiment comparison test that determines if there is a statistically significant difference in one of the treatments
postHocTest - Post-hoc test that determines which treatments are statistically significantly different
alpha - P-value threshold, such that if the null-hypothesis probability is below alpha then we reject the null hypothesis.
Method Detail

clone

public MultipleComparisonExperiment 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 AbstractCloneableSerializable
Returns:
A clone of this object.

getBlockExperimentComparison

public BlockExperimentComparison<Number> getBlockExperimentComparison()
Getter for blockExperimentComparison

Returns:
Block-experiment comparison test that determines if there is a statistically significant difference in one of the treatments

setBlockExperimentComparison

public void setBlockExperimentComparison(BlockExperimentComparison<Number> blockExperimentComparison)
Setter for blockExperimentComparison

Parameters:
blockExperimentComparison - Block-experiment comparison test that determines if there is a statistically significant difference in one of the treatments

getPostHocTest

public MultipleHypothesisComparison<Collection<? extends Number>> getPostHocTest()
Getter for postHocTest

Returns:
Post-hoc test that determines which treatments are statistically significantly different

setPostHocTest

public void setPostHocTest(MultipleHypothesisComparison<Collection<? extends Number>> postHocTest)
Setter for postHocTest

Parameters:
postHocTest - Post-hoc test that determines which treatments are statistically significantly different

getAlpha

public double getAlpha()
Getter for alpha

Returns:
P-value threshold, such that if the null-hypothesis probability is below alpha then we reject the null hypothesis.

setAlpha

public void setAlpha(double alpha)
Setter for alpha

Parameters:
alpha - P-value threshold, such that if the null-hypothesis probability is below alpha then we reject the null hypothesis.

evaluateNullHypothesis

public MultipleComparisonExperiment.Statistic evaluateNullHypothesis(Collection<? extends Collection<? extends Number>> treatments)
Description copied from interface: BlockExperimentComparison
Evaluates the null hypothesis for the given block-design treatments

Specified by:
evaluateNullHypothesis in interface BlockExperimentComparison<Number>
Parameters:
treatments - Collection of treatments for the block-design experiment, where each treatment contains
Returns:
The confidence for the null hypothesis.

evaluateNullHypothesis

public MultipleComparisonExperiment.Statistic evaluateNullHypothesis(Collection<? extends Number> data1,
                                                                     Collection<? extends Number> data2)
Description copied from interface: NullHypothesisEvaluator
Computes the probability that two data were generated by the same distribution. NullHypothesisProbability=1 means that the distributions are likely the same, NullHypothesisProbability=0 means they are likely NOT the same, and NullHypothesisProbability less than 0.05 is the standard statistical significance test. This is the "p-value" that social scientists like to use.

Specified by:
evaluateNullHypothesis in interface NullHypothesisEvaluator<Collection<? extends Number>>
Parameters:
data1 - First dataset to consider
data2 - Second dataset to consider
Returns:
Probability that the two data were generated by the same source. A value of NullHypothesisProbability less than 0.05 is the standard point at which social scientists say two distributions were generated by different sources.

evaluateNullHypotheses

public MultipleComparisonExperiment.Statistic evaluateNullHypotheses(Collection<? extends Collection<? extends Number>> data)
Description copied from interface: MultipleHypothesisComparison
Evaluates the null hypotheses associated with the given collection of data.

Specified by:
evaluateNullHypotheses in interface MultipleHypothesisComparison<Collection<? extends Number>>
Parameters:
data - Data from each treatment to consider
Returns:
Statistic that summarizes the multiple comparison test

evaluateNullHypotheses

public MultipleComparisonExperiment.Statistic evaluateNullHypotheses(Collection<? extends Collection<? extends Number>> data,
                                                                     double uncompensatedAlpha)
Description copied from interface: MultipleHypothesisComparison
Evaluates the null hypotheses associated with the given collection of data.

Specified by:
evaluateNullHypotheses in interface MultipleHypothesisComparison<Collection<? extends Number>>
Parameters:
data - Data from each treatment to consider
uncompensatedAlpha - Uncompensated alpha (p-value threshold) for the multiple comparison test, must be [0,1]
Returns:
Statistic that summarizes the multiple comparison test