org.apache.commons.math.stat.correlation
Class SpearmansRankCorrelationTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.math.stat.correlation.PearsonsCorrelationTest
              extended by org.apache.commons.math.stat.correlation.SpearmansRankCorrelationTest
All Implemented Interfaces:
junit.framework.Test

public class SpearmansRankCorrelationTest
extends PearsonsCorrelationTest

Test cases for Spearman's rank correlation

Since:
2.0
Version:
$Revision: 799857 $ $Date: 2009-08-01 09:07:12 -0400 (Sat, 01 Aug 2009) $

Field Summary
 
Fields inherited from class org.apache.commons.math.stat.correlation.PearsonsCorrelationTest
longleyData, swissData
 
Constructor Summary
SpearmansRankCorrelationTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testConsistency()
           
 void testConstant()
          Constant column
 void testCovarianceConsistency()
          Verify that creating correlation from covariance gives same results as direct computation from the original matrix
 void testInsufficientData()
          Insufficient data
 void testLongly()
          Test Longley dataset against R.
 void testStdErrorConsistency()
          Verify that direct t-tests using standard error estimates are consistent with reported p-values
 void testSwiss()
          Test R swiss fertility dataset.
 
Methods inherited from class org.apache.commons.math.stat.correlation.PearsonsCorrelationTest
createLowerTriangularRealMatrix, createRealMatrix, fillUpper, testSwissFertility
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpearmansRankCorrelationTest

public SpearmansRankCorrelationTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

testLongly

public void testLongly()
                throws Exception
Test Longley dataset against R.

Overrides:
testLongly in class PearsonsCorrelationTest
Throws:
Exception

testSwiss

public void testSwiss()
               throws Exception
Test R swiss fertility dataset.

Throws:
Exception

testConstant

public void testConstant()
Constant column

Overrides:
testConstant in class PearsonsCorrelationTest

testInsufficientData

public void testInsufficientData()
Insufficient data

Overrides:
testInsufficientData in class PearsonsCorrelationTest

testConsistency

public void testConsistency()
Overrides:
testConsistency in class PearsonsCorrelationTest

testStdErrorConsistency

public void testStdErrorConsistency()
                             throws Exception
Description copied from class: PearsonsCorrelationTest
Verify that direct t-tests using standard error estimates are consistent with reported p-values

Overrides:
testStdErrorConsistency in class PearsonsCorrelationTest
Throws:
Exception

testCovarianceConsistency

public void testCovarianceConsistency()
                               throws Exception
Description copied from class: PearsonsCorrelationTest
Verify that creating correlation from covariance gives same results as direct computation from the original matrix

Overrides:
testCovarianceConsistency in class PearsonsCorrelationTest
Throws:
Exception


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.