org.statcato.statistics.inferential.nonparametrics
Class RankCorrelation

java.lang.Object
  extended by org.statcato.statistics.inferential.nonparametrics.RankCorrelation

public class RankCorrelation
extends java.lang.Object

Spearman's rank correlation between two variables. Computes the correlation between two variables using their ranks.

Since:
1.0
Version:
%I%, %G%
Author:
Margaret Yau
See Also:
CorrelationRegression

Constructor Summary
RankCorrelation(java.util.Vector<java.lang.Double> x, java.util.Vector<java.lang.Double> y, double sig)
          Constructor.
 
Method Summary
 double CriticalValue()
          Returns the critical value for r corresponding to the given significance.
 int N()
          Returns the number of data pairs
 double PValue()
          Returns the p-Value corresponding to the test statistic.
 double RankCorrelationCoeff()
          Returns the rank correlation coefficient.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RankCorrelation

public RankCorrelation(java.util.Vector<java.lang.Double> x,
                       java.util.Vector<java.lang.Double> y,
                       double sig)
Constructor. The x and y variables are provided as vectors of double type of the same length. The values in the two vectors at the same position are considered to be a data point. The signifiance level of the test is also provided.

Parameters:
x - variable 1
y - variable 2
sig - significance
Method Detail

N

public int N()
Returns the number of data pairs

Returns:
n

RankCorrelationCoeff

public double RankCorrelationCoeff()
Returns the rank correlation coefficient.

Returns:
rs

CriticalValue

public double CriticalValue()
Returns the critical value for r corresponding to the given significance.

Parameters:
significance - significance
Returns:
critical value (positive)

PValue

public double PValue()
Returns the p-Value corresponding to the test statistic.

Returns:
p-Value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object