0

I have two arrays

   double arr[]=data.attributeToDoubleArray(4);
   double arr0[]=data.attributeToDoubleArray(0);

To calculate p value in common apache it has been documented as follows :

 public double anovaPValue(Collection<double[]> categoryData)
               throws NullArgumentException,
                      DimensionMismatchException,
                      ConvergenceException,
                      MaxCountExceededException

       Computes the ANOVA P-value for a collection of double[] arrays.
       Preconditions:

        The categoryData Collection must contain double[] arrays.
        There must be at least two double[] arrays in the categoryData collection and each of these arrays must contain at least two values.

How can I convert my two arrays in collection so that I can use the above function ?

1 Answers1

4

you can try this:

double arr[]=data.attributeToDoubleArray(4);
double arr0[]=data.attributeToDoubleArray(0);

List<double[]> newArr = Arrays.asList(arr, arr0);
Ebrahim Poursadeqi
  • 1,776
  • 2
  • 17
  • 27