# [R] Exact Binomial test feature or bug?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Apr 30 10:16:16 CEST 2004

alan.arnholt at unavarra.es writes:

> Dear R Users,
>
> Is the p-value reported in a two-tailed binomial exact
> test in error or is it a feature?

A feature. Two sided exact tests are really a contradiction in terms
since there are multiple ways of doing it and confidence intervals are
even worse. We do at times consider making the different methods
selectable. There's a similar issue with fisher.test.

> If it is a feature, could someone provide a reference
> for its two-tailed p-value computations?

It's just the sum of probabilities of outcomes with a smaller
likelihood. (In fisher.test for more than 2x2 tables that is basically
the only thing you can do, so it does give some consistency.)

> Using Blaker's (2000 - Canad. J. Statist 28: 783-798)
> approach,the p-value is the minimum of the two-tailed
> probabilities $P \left(Y\geq y_{obs}\right)$ and
> $P\left(Y\leq y_{obs}\right)$ plus an attainable
> probability in the other tail that is as close as
> possible to, but not greater than that one-tailed
> probability.

--
O__  ---- Peter Dalgaard             Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
(*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907