Skip to main content
4 of 4
added 21 characters in body
COOLSerdash
  • 31.2k
  • 10
  • 104
  • 157

There are several ways to define two-sided $p$-values in this case. Michael Fay lists three in his article. The following is mostly taken from his article.

Suppose you have a discrete test statistic $t$ with random variable $T$ such that larger values of $T$ imply larger values of a parameter of interest, $\theta$. Let $F_\theta(t)=\Pr[T\leq t;\theta]$ and $\bar{F}_\theta(t)=\Pr[T\geq t;\theta]$. Suppose the null value is $\theta_0$. The one-sided $p$-values are then denoted by $F_{\theta_0}(t), \bar{F}_{\theta_0}(t)$, respectively.

The three ways listed to define two-sided $p$-values are as follows:

$\textbf{central:}$ $p_{c}$ is 2 times the minimum of the one-sided $p$-values bounded above by 1: $$ p_c=\min\{1,2\times\min(F_{\theta_0}(t), \bar{F}_{\theta_0}(t))\}. $$

$\textbf{minlike:}$ $p_{m}$ is the sum of probabilities of outcomes with likelihoods less than or equal to the observed likelihood: $$ p_m=\sum_{T:f(T)\leq f(t)} f(T) $$ where $f(t) = \Pr[T=t;\theta_0]$.

$\textbf{blaker:}$ $p_b$ combines the probability of the smaller observed tail with the smallest probability of the opposite tail that does not exceed that observed probability. This may be expressed as: $$ p_b=\Pr[\gamma(T)\leq\gamma(t)] $$ where $\gamma(T)=\min\{F_{\theta_0}(T), \bar{F}_{\theta_0}(T))\}$.

If $p(\theta_0)$ is a two-sided $p$-value testing $H_0:\theta=\theta_0$, then its $100(1-\alpha)\%$ matching confidence interval is the smallest interval that contains all $\theta_0$ such that $p(\theta_{0})>\alpha$. The matching confidence limits to the $\textbf{central}$ test are $(\theta_{L},\theta_U)$ which are the solutions to: $$ \alpha/2=\bar{F}_{\theta_L}(t) $$ and $$ \alpha/2=F_{\theta_U}(t). $$

The contradiction arises because poisson.test returns $p_m$ ($\textrm{minlike}$) as the $p$-value but confidence limits that are based on the $\textrm{central}$ test!

The exactci package returns the correct matching $p$-values and confidence limits (you can set the method using the option tsmethod):

library(exactci)

poisson.exact(x=10, r=5.22, tsmethod = "central")

    Exact two-sided Poisson test (central method)

data:  10 time base: 1
number of events = 10, time base = 1, p-value = 0.08105
alternative hypothesis: true event rate is not equal to 5.22
95 percent confidence interval:
  4.795389 18.390356
sample estimates:
event rate 
        10 

Now there is no conflict between the $p$-value and the confidence intervals. In rare cases, even the exactci function will result in inconsistencies, which is mentioned in Michael Fays article.

COOLSerdash
  • 31.2k
  • 10
  • 104
  • 157