public static double chiSquared(double[][] matrix,boolean yates){
  int df=(matrix.length - 1) * (matrix[0].length - 1);
  return Statistics.chiSquaredProbability(chiVal(matrix,yates),df);
}

public static double chiSquared ( double [ ] [ ] matrix , boolean yates ) { int df = ( matrix . length - 1 ) * ( matrix [ 0 ] . length - 1 ) ; return Statistics . chiSquaredProbability ( chiVal ( matrix , yates ) , df ) ; }
returns chi - squared probability for a given matrix .
