get a p-value which is greater than 1 in the sign test

50 Views Asked by At

I was confused about calculating the p value for both single sampled sign tests.

Suppose we have a sample size of 12 and 6 values are below our hypothesized median of $m_x$and 6 are above.

And that $H0:m=m_x$ and $H1:m\neq m_x$ with $\alpha=0.05$.

The p value: $2\sum_{i=0}^6\tbinom{12}{i}(\frac{1}{2})^n$, which is obviously geater than 1.

If we run the R code, we get that the p-value is 1.

I know that fact that p-value can never be greater than 1. But in almost reference books we use the above the formula to calculate the p-value. Can anyone show me the wrong place, thanks in advance.