January 23, 201313 yr Anyone have any familiarity with using statistic java classes with SM? Specifically we would like to use the JSC (Java Statistical Classes) found here: http://www.jsc.nildram.co.uk We need some heavy stats work and having access to this jar would be a big help. Ideas? By the way, we are currently interested in Fisher’s Exact test. Thanks
January 24, 201313 yr Solution Bailey Here's a quick function to get access to the functionality listed in the API // Stats ( table_data ) // 13_01_22 JR // JR // input comma sep list of values e.g.: 2,5,8,9 import jsc.contingencytables.ContingencyTable2x2 import jsc.contingencytables.FishersExactTest //test //table_data = '1,2,3,4' td = table_data.tokenize(',') ct = new ContingencyTable2x2(td[0].toInteger(), td[1].toInteger(), td[2].toInteger(), td[3].toInteger()) fet = new FishersExactTest(ct) /* enable any of these */ //return fet.getApproxSP() //return fet.getChiSquared() //return fet.getOneTailedMidP() //return fet.getOneTailedSP() //return fet.getOppositeTailProb() //return fet.getSP() //return fet.getTestStatistic() //return ct John
January 25, 201313 yr Author Thanks Works great. Just so everyone knows, you can find all the classes at: http://www.jsc.nildram.co.uk/api/index.html
January 31, 201312 yr Newbies Bailey Here's a quick function to get access to the functionality listed in the API // Stats ( table_data ) // 13_01_22 JR // JR // input comma sep list of values e.g.: 2,5,8,9 import jsc.contingencytables.ContingencyTable2x2 import jsc.contingencytables.FishersExactTest //test //table_data = '1,2,3,4' td = table_data.tokenize(',') ct = new ContingencyTable2x2(td[0].toInteger(), td[1].toInteger(), td[2].toInteger(), td[3].toInteger()) fet = new FishersExactTest(ct) /* enable any of these */ //return fet.getApproxSP() //return fet.getChiSquared() //return fet.getOneTailedMidP() //return fet.getOneTailedSP() //return fet.getOppositeTailProb() //return fet.getSP() //return fet.getTestStatistic() //return ct John Hi John, Your solution works great. Thanks! The only other issue I have is - If one of the input integers is 0, the output for return fet.getSP() is an error message. For e.g.- table_data = '0,2,3,4' , output Error is java.lang.IllegalArgumentException: Invalid variate-value 0. Any Advice on this ?
Create an account or sign in to comment