|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.utils.math.statistics.SpearmanCorr
public class SpearmanCorr
SpearmanCorr -- get Spearman rank order correlations for an m x n matrix.
| Constructor Summary | |
|---|---|
protected |
SpearmanCorr()
Don't allow instantiation, but do allow subclassing. |
| Method Summary | |
|---|---|
static double |
sigSpearmanCorr(double r,
int n)
Calculate approximate significance of Spearman correlation coefficient. |
static Matrix |
spearmanCorr(Matrix dataMatrix)
Generate a Spearman rank-order correlation matrix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SpearmanCorr()
| Method Detail |
|---|
public static Matrix spearmanCorr(Matrix dataMatrix)
dataMatrix - The n x m data matrix for which to compute
a Spearman rank-order correlation matrix.
We calculate Spearman's rank-order correlation coefficient by computing the rank-order of each variable stored as a column in a matrix. Ties are handled by mid-ranking. Computing the usual Pearson correlation on the rank ordered data yields Spearman's correlation coefficient.
public static double sigSpearmanCorr(double r,
int n)
r - The Spearman correlation coefficient.n - The sample size.
The approximate significance of Spearman's correlation r is computing using Student's t distribution with ( n - 2 ) degrees of freedom, as follows:
df = n - 2
t = r * sqrt( df / ( 1 - r^2 ) )
sig(r) = sigt( t , df )
If r is exactly one, the significance is returned as zero.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||