Hi,

In the below example 1, (x=

I would expect the p-value of the two-tailed test to be 2* p(X≤

I understand that probability in the right tail is

So it seems that in R takes the value which is closer to

but still, don't feel it is correct to choose one of the discrete values.

Some test examples compare the one value based on x (in this example

So this is exactly like using 2* p(X≤2)

So my question if there is a correct method? or why not using 2* p(X≤2) in this example?

Thanks

Example 1

> binom.test(x=2, n=20, p = 0.25, alternative="less", conf.level = 0.95)$p.value

[1]

> binom.test(x=2, n=20, p = 0.25, alternative="two.sided", conf.level = 0.95)$p.value

[1]

p(X≥8)=

p(X≥9)=0.040925168

0.09126043+

Example 2

> binom.test(x=4, n=20, p = 0.25, alternative="less", conf.level = 0.95)$p.value

[1]

> binom.test(x=4, n=20, p = 0.25, alternative="two.sided", conf.level = 0.95)$p.value

[1]

p(X≥5)=

p(X≥6)=0.382827346

0.4148415+

In the below example 1, (x=

**2**, n=**20**, p=**0.25**) two tailed test.I would expect the p-value of the two-tailed test to be 2* p(X≤

**2**)=2***0.09126043=0.18252086**I understand that probability in the right tail is

**discrete**so it can be**0.101811857**or**0.040925168**So it seems that in R takes the value which is closer to

**0.09126043**(some cases bigger and some cases smaller)but still, don't feel it is correct to choose one of the discrete values.

Some test examples compare the one value based on x (in this example

**0.09126043**) to alpha/2.So this is exactly like using 2* p(X≤2)

So my question if there is a correct method? or why not using 2* p(X≤2) in this example?

Thanks

Example 1

> binom.test(x=2, n=20, p = 0.25, alternative="less", conf.level = 0.95)$p.value

[1]

**0.09126043**> binom.test(x=2, n=20, p = 0.25, alternative="two.sided", conf.level = 0.95)$p.value

[1]

**0.1930723**p(X≥8)=

**0.101811857**p(X≥9)=0.040925168

0.09126043+

**0.101811857**=0.1930723Example 2

> binom.test(x=4, n=20, p = 0.25, alternative="less", conf.level = 0.95)$p.value

[1]

**0.4148415**> binom.test(x=4, n=20, p = 0.25, alternative="two.sided", conf.level = 0.95)$p.value

[1]

**0.7976688**p(X≥5)=

**0.585158497**p(X≥6)=0.382827346

0.4148415+

**0.382827346**=0.7976688
Last edited: