I was looking for the same thing myself... And I found it. I don't think I can insert mathML here, and I think code is a much better explanation than stupid mathy symbols, sere's some code I wrote minus some comments. It could be written to be much faster, but it is plenty fast enough for the number of trials we'd be talking about. Can you read Python?

Quick explanation:factorial() does exactly what its name says. It computes the factorial of a number.binomial() uses the binomial distribution function to compute the probability that there would be exactly k occurances of some event of probability p occuring in n trials.abxBinomial() computes the ABX pval you want. It takes the sum of the binomial function for correct, correct+1 ... num_trials.

This method is fine for use on a computer/calculator, but if you're working it out by hand there are formulas which approximate the value more quickly (if less accurately). Also, be aware that it overflows doubles if you take 170+ trials.

--------------------

I am *expanding!* It is so much *squishy* to *smell* you! *Campers* are the best! I have *anticipation* and then what? Better parties in *the middle* for sure.http://www.phong.org/

I admint I am not an expert, but the so-called P-value probably refers to the Greek letter Rho, which looks pretty much like a P.

Rho stands for probability.

It is quite easy to calculate the value. Say you have a normal 6 edged dice. The probability (Rho) of getting a 6 in the first try is 1/6 ~ 16,7%. The probability (Rho) of getting 6 in the fist try and 2 in the second try is 1/6 * 1/6 ~ 2,7%.

When you are doing simple ABX tests with only two possible results use 1/2 instead of 1/6.

I admint I am not an expert, but the so-called P-value probably refers to the Greek letter Rho, which looks pretty much like a P.

Rho stands for probability.

It is quite easy to calculate the value. Say you have a normal 6 edged dice. The probability (Rho) of getting a 6 in the first try is 1/6 ~ 16,7%. The probability (Rho) of getting 6 in the fist try and 2 in the second try is 1/6 * 1/6 ~ 2,7%.

When you are doing simple ABX tests with only two possible results use 1/2 instead of 1/6.

I'm pretty sure that's not it. The P-value is finding the odds that something occured by chance alone, without any other external factors.

Conceptwise, it's exactly the same as the method phong uses, although not as straightforward. The advantage is mainly that it's probably a bit faster and it doesn't overflow during your casual 170+ trials ABX test I don't know exactly when it does overflow, but I tested it once for 10000 trials with 5000 correct and it got the right result after about 5 minutes of calculating (well, this is a scientific forum, you know.. every last 0.0001% of certainty in an ABX test is valued )When it comes to optimizing programs I'm a total amateur, though (I rarely do much optimizing in my programs), so there are probably much better ways to calculate that.

In my version of abchr, I don't bother calculating something if it's not going to change the final answer by a certain amount (p values < 0.001 are not reported to their full precision). This skirts both the underflow and speed issues.

In my version of abchr, I don't bother calculating something if it's not going to change the final answer by a certain amount (p values < 0.001 are not reported to their full precision). This skirts both the underflow and speed issues.

Well, that might be true. But as a math student, I take pride in considering this unprofessional.

In my version of abchr, I don't bother calculating something if it's not going to change the final answer by a certain amount (p values < 0.001 are not reported to their full precision). This skirts both the underflow and speed issues.

Well, that might be true. But as a math student, I take pride in considering this unprofessional.

In my version of abchr, I don't bother calculating something if it's not going to change the final answer by a certain amount (p values < 0.001 are not reported to their full precision). This skirts both the underflow and speed issues.

Well, that might be true. But as a math student, I take pride in considering this unprofessional.

Haha! Since I'm an engineer, I take that as a compliment.

ff123

LOL! Who said there can be no holy wars in a perfectly scientific discussion?