moj.similarity.measures
Class BinCramerPhiS_row

java.lang.Object
  extended by moj.similarity.SimilarityMeasure
      extended by moj.similarity.measures.BinCramerPhiS_row

public class BinCramerPhiS_row
extends SimilarityMeasure

CRAMER PHI MEASURE OF ASSOCIATION
http://www.psych.cornell.edu/Darlington/crosstab/table3.htm
The Cramer phi and phi2 are simple transformations of the familiar Pearson chi-square statistic for testing association in a frequency table. This statistic uses the familiar formula:
chi-square = SUM((o-e)^2/e)
where e = row total * column total / N
phi = sqrt(chisquare/(N(MRC-1)))
In 2x2 tables the Cramer phi reduces to the absolute value of the familiar phi-coefficient, which in turn equals the Pearson correlation between the row and column variables when both variables are coded numerically such as 0-1 or 1-2.
Similarity [0, 1].
Usage: for binary data.

Version:
2004-Oct-14
Author:
Martin Hassel

Constructor Summary
BinCramerPhiS_row()
           
 
Method Summary
 double[][] analyzeMatrix(float[][] data_matrix)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinCramerPhiS_row

public BinCramerPhiS_row()
Method Detail

analyzeMatrix

public double[][] analyzeMatrix(float[][] data_matrix)
Specified by:
analyzeMatrix in class SimilarityMeasure
Parameters:
data_matrix - an array of float arrays denoting the rows in the matrix that are to be compared for similarity.
Returns:
an array of double arrays containing the similarities between all rows