Closed betrw closed 3 years ago
I guess the two samples Cramer test is the Anderson-Darling-Test?
@pmgj: can you help on this? Thanks!
Hi,
This cramer test works comparing the attribute values of a List of Instance elements. An example that can read values from ARFF files is:
List<Instance> x = Cramer.fileToInstances("test1-x.arff");
List<Instance> y = Cramer.fileToInstances("test1-y.arff");
Cramer c = new Cramer();
Cramer.CramerTest ct = c.cramerTest(x, y);
System.out.println("p Value.: " + ct.pValue);
System.out.println("Critical value: " + ct.critValue);
System.out.println("Statistic: " + ct.statistic);
The CramerTest is only used inside the class. I probably had to make it private. This Java implementation was based on the Cramer test source code available in the R statistic tool.
Thanks a lot.
Submitting the parameters to the method:
Cramer c = new Cramer(); c.cramerTest1(CR1, CR2); pi.CremerTValue = ?
fails with the error 'ArrayStoreException' at the second line after passing the parameters.
I tried:
List<List>CR1 = new ArrayList<List>();
List<List>CR2 = new ArrayList<List>();
CR1.add(First); CR2.add(Second);
--or--
List<List>CR1 = Arrays.asList(First);
List<List>CR2 = Arrays.asList(Second);
Both declarations failed.
First and Second are both of the type ArrayList with a size of 177 items.
CR1 and CR2 have one item that contain 177 values.
How can I implement the two sample Cramer-Mises T test?