Results 1 to 3 of 3
Thread: Chi sqaure test
- 06-21-2010, 03:11 PM #1
Member
- Join Date
- May 2010
- Posts
- 17
- Rep Power
- 0
Chi sqaure test
Hi,
I want to do Chi-square test, to find the weather two distribution are same or not.
I want to use some statistical function to do that.
i found common math library to that test.
But I don't know how to use that library.
Math - Commons-Math: The Apache Commons Mathematics Library
and I find the code as
long[] observed = {10, 9, 11};
double[] expected = {10.1, 9.8, 10.3};
System.out.println(TestUtils.chiSquare(expected, observed));
If anyone can give me the idea about how to sue it, that will be very helpful for me.
Thank you
- 06-21-2010, 03:14 PM #2
What happens when you execute your program?
If the answer is wrong, can you explain what it should be?
- 06-21-2010, 03:25 PM #3
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
To calculate the chi-squared value for simple data, you don't need any special library. All you have to do is to apply the formula for the calculation to the data:
http://en.wikipedia.org/wiki/Chi-square_statistic
Now to get a p value from the chi-square result and your degree of freedoms, you'll need to use a look-up table or some external library.
Similar Threads
-
Help with this test class
By fsuarjun03 in forum New To JavaReplies: 10Last Post: 06-20-2011, 03:56 AM -
Is it possible to test for NaN?
By AJArmstron@aol.com in forum New To JavaReplies: 7Last Post: 05-07-2010, 02:22 AM -
Test - please delete
By Fubarable in forum Forum LobbyReplies: 7Last Post: 04-25-2009, 08:08 PM -
JUnit Test Help!
By pharo in forum New To JavaReplies: 0Last Post: 04-10-2009, 05:15 PM -
Test Advisory Panel-Telecommute- Test your Java skills + share insights on Java tests
By michelle in forum Jobs OfferedReplies: 0Last Post: 04-05-2008, 12:38 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks