moj.similarity.measures
Class BinCramerPhiS_row
java.lang.Object
moj.similarity.SimilarityMeasure
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
BinCramerPhiS_row
public BinCramerPhiS_row()
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