I need to do the chiSquaredTest. I'm using the Apache Commons Math library but not sure what is a long[][]
what the difference to a long[]
? Here is the method description :
public double chiSquareTest(long[][] counts)
throws NullArgumentException,
DimensionMismatchException,
NotPositiveException,
MaxCountExceededException
Returns the observed significance level, or p-value, associated with a chi-square test of independence based on the input counts array, viewed as a two-way table.
The rows of the 2-way table are count[ 0 ], ... , count[count.length - 1]
Preconditions:
- List item All counts must be ≥ 0.
- The count array must be rectangular (i.e. all count[ i ] subarrays must have the same length).
- The 2-way table represented by counts must have at least 2 columns and at least 2 rows.
- If any of the preconditions are not met, an IllegalArgumentException is thrown.
Parameters:
- counts - array representation of 2-way table
Returns:
- p-value