[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    Re: [MATH] Estimate of the population mean given a sample
From:       Thomas Neidhart <thomas.neidhart () gmail ! com>
Date:       2013-09-12 8:28:17
Message-ID: CAJSjvwszbAq7CK7Q=otjnd3V0FHwybCcyKcx10u2OVut3nR0FQ () mail ! gmail ! com
[Download RAW message or body]


Hi Thorsten,

contributions will be highly appreciated, feel free to already create an
issue for the binomial test.

Thomas


On Thu, Sep 12, 2013 at 2:28 AM, email@thorstenschaefer.de <
email@thorstenschaefer.de> wrote:

> 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
> <thomas.neidhart@gmail.com>:
>
> >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
> >>
> >> 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=0.6
> >BinomialDistribution s1 = new BinomialDistribution(5, 0.6);
> >System.out.println(1 - s1.cumulativeProbability(4-1));
> >
> >// = 0.3369 > 0.05 significance level
> >// thus null hypothesis can not be rejected
> >
> >BinomialDistribution s2 = new BinomialDistribution(100, 0.6);
> >System.out.println(1 - s2.cumulativeProbability(80-1));
> >
> >// = 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
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic