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 8092B10CB4 for ; Thu, 12 Sep 2013 00:29:14 +0000 (UTC) Received: (qmail 38326 invoked by uid 500); 12 Sep 2013 00:29:13 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 38241 invoked by uid 500); 12 Sep 2013 00:29:13 -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 38233 invoked by uid 99); 12 Sep 2013 00:29:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Sep 2013 00:29:12 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [80.67.31.36] (HELO smtprelay02.ispgateway.de) (80.67.31.36) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Sep 2013 00:29:08 +0000 Received: from [10.128.0.1] (helo=exchange.df.eu) by smtprelay02.ispgateway.de with esmtps (TLSv1:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1VJulm-0002d0-QO for user@commons.apache.org; Thu, 12 Sep 2013 02:28:26 +0200 Received: from ECCR13PUBLIC.exchange.local ([10.128.2.112]) by efe01.exchange.local ([10.128.0.1]) with mapi; Thu, 12 Sep 2013 02:28:26 +0200 From: "email@thorstenschaefer.de" To: Commons Users List Date: Thu, 12 Sep 2013 02:28:24 +0200 Subject: Re: [MATH] Estimate of the population mean given a sample Thread-Topic: [MATH] Estimate of the population mean given a sample Thread-Index: Ac6vTv7VZX5fuEYNT7SLaYJHVRdUYw== Message-ID: In-Reply-To: <5230C7A0.9050501@gmail.com> Accept-Language: de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.7.130812 acceptlanguage: de-DE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Thanks Thomas, that worked :). I'm not yet too familiar with the statistics background, but I guess I'll spend some more time with it and if I really got it, I'll write a patch for a binomial test. Cheers, Thorsten Am 9/11/13 4:42 PM schrieb "Thomas Neidhart" unter : >On 09/11/2013 08:37 PM, email@thorstenschaefer.de wrote: >> We have a sample which comes from a binomial process with unknown >>probability. Is it possible to get the likelihood of the population is >>larger than a user-specified value (with e.g. 95% certainty) in >>commons-math? >> For example, given we have two samples: >> S1: we have 4 out of 5 successes >> S2: we have 80 out of 100 successes >>=20 >> I would like to know the probability that the real mean is larger than >>60% given one of the samples above. Is there an easy way to calculate it? > >Hi Thorsten, > >there is not yet a binomial test available (would be a nice addition), >but you can calculate the requested values with the binomial distribution: > >// create a binomial distribution with null hypothesis of p=3D0.6 >BinomialDistribution s1 =3D new BinomialDistribution(5, 0.6); >System.out.println(1 - s1.cumulativeProbability(4-1)); > >// =3D 0.3369 > 0.05 significance level >// thus null hypothesis can not be rejected > >BinomialDistribution s2 =3D new BinomialDistribution(100, 0.6); >System.out.println(1 - s2.cumulativeProbability(80-1)); > >// =3D 1.64e-5 < 0.05 significance level >// thus null hypothesis can be rejected >// the observed probability must be larger > >Note: the - 1 is used to get the same results as with R binom.test >see also >http://stats.stackexchange.com/questions/44125/is-there-an-error-in-the-on >e-sided-binomial-test-in-r > > >Best regards, > >Thomas > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >For additional commands, e-mail: user-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org