Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE8E018A18 for ; Fri, 18 Dec 2015 09:34:58 +0000 (UTC) Received: (qmail 4932 invoked by uid 500); 18 Dec 2015 09:34:57 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 4812 invoked by uid 500); 18 Dec 2015 09:34:57 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 4801 invoked by uid 99); 18 Dec 2015 09:34:57 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2015 09:34:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 30EA3C8EAF for ; Fri, 18 Dec 2015 09:34:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id yAOJq23e9hrc for ; Fri, 18 Dec 2015 09:34:45 +0000 (UTC) Received: from merkurneu.hrz.uni-giessen.de (merkurneu.hrz.uni-giessen.de [134.176.2.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 2F942201F7 for ; Fri, 18 Dec 2015 09:34:45 +0000 (UTC) Received: from mailgw32.hrz.uni-giessen.de by merkurneu.hrz.uni-giessen.de with ESMTP for user@commons.apache.org; Fri, 18 Dec 2015 10:34:15 +0100 Received: from merkurneu.hrz.uni-giessen.de (merkurneu.hrz.uni-giessen.de [134.176.2.3]) by mailgw32.hrz.uni-giessen.de (Postfix) with ESMTP id 9F284587ED9 for ; Fri, 18 Dec 2015 10:34:06 +0100 (CET) Received: from [134.176.2.3] by merkurneu.hrz.uni-giessen.de with ESMTP for user@commons.apache.org; Fri, 18 Dec 2015 10:34:06 +0100 To: user@commons.apache.org From: Michael Menzel Subject: Weird results from ChiSquareTest Message-Id: <5673D30B.2000705@bioinfsys.uni-giessen.de> Date: Fri, 18 Dec 2015 10:34:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-HRZ-JLUG-MailScanner-Information: Passed JLUG virus check X-HRZ-JLUG-MailScanner: No virus found X-Envelope-From: michael.menzel@bioinfsys.uni-giessen.de -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, I have a problem with the ChiSquareTest Method supplied by Apache Commons. I already postet it on StackOverflow, so I will just copy everything from there (https://stackoverflow.com/questions/34333243/apachecommons-weird-results-from-chisquaretest) I use the method chiSquareTest(double[] expected, long[] observed); But the values I get back don't make sense to me. So I tried numerous ChiSquare Online Calculators to find out what this function calculates. An example: Group 1: {25,25} Group 2: {30,20} (Taken from Wikipedia, German Chi Square Test article) P- values from: http://www.quantpsy.org/chisq/chisq.htm and http://vassarstats.net/newcs.html P = 0.3149 and 0.31490284 0.42154642 and 0.4201 (with and without Yates Correction) Apache Commons: 0.1489146731787664 Code: ChiSquareTest tester = new ChiSquareTest(); long[] b = {25,25}; double[] a = {30,20}; tester.chiSquareTest(a,b); Another thing I do not understand is the need to have a long and a double array. Why not two long arrays? Maybe one of you can help me understand the result. Thanks in advance. Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWc9MIAAoJEL6dFkylAyuLeY4QAInDSvdI0pU+9QC9xxKNpvWb OK1s32zcj+B8MkNCQQ+IrFg8nyJiaT9EMyTBC4xKDdB2fb8rVZyV6cwAjh1TOcNf vo+wqOTtMcPW92eXEHxaJkrknB3dbl/Jc8NQX3afF+rmEnf9I1qfQUfhwoyOm79G WjLqgm1PGi7SY4BwjBbHt8sUxPowLUHj6ZbSpRkVDT64rb1PSeo9tet/Mnzwk1Vo wML/IOayxQlLMjYgbXDeEmP3nQhx3qY1+zc6TmvDHI5fMEQRAz1hCvOO1MnwlNUU +hEoJrOmkz3nXyenq4fw9pqKQNZOUUwOghptkK/SQqki+qyeIlF2dTZHaGycEckM Lcot/twki2xxvF8Z0T4MLBSBJKBQ20MtvQrUBbgIa/msg9JeFVUYYyNbFVHm666/ xBJOo1pyeRGYl+q0/nMvbMUTHeY7oNB4v5JGS/8aQjWooSMdDp0INXcdEOiiw5Oo +7i5kHxZBvw1AwJ7cNmGFlRIOCV2W97Pv205+ziId70tNLYGvQH+OGRej2sZt911 CP5c7ZXRacHR5DeBMzxIIVOniulCEMHQxwXX0J86lxL3rVzNcwi6J+A2VLckewkC 20WH6o2ofPbAbTRZvJT91mbfnDhKIdosGhYDjlpY42dAnE/jAnA7MmuTem3iQzom FNmS9pIsGYyByDsBM9Xj =iM1r -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org