I'm trying to solve a question from an introductory textbook on statistics. I am to use the Sign Test and determine if there is significant evidence that the median of a dataset $M$ is "at least" 20 (which I understand to be explicitly $\geq 20$ as to include $20$), and I need to calculate the corresponding P-value.
So far, the textbook has worked with null-hypotheses in the form of equalities (as in $H_0: M = 20$ vs $H_A: M > 20$ for example). But I have understood that this equality is not exact and in the previous example would be equivalent to something along the lines of $H_0: M \leq 20$ vs $H_A: M > 20$, where (paraphrased in my own understanding) the "worst case" occurs at $20$ and that is why we compute $M=20$.
Using that, and noting that for the dataset I have $n = 10$ and $S_{obs} = 9$ (the critical value), and thinking that I must include "$=$" in the null-hypothesis, I defined my hypotheses as:
$H_0: M = 20$ (aka $H_0: M \geq 20$) vs $H_A: M < 20$.
For this I got the p-value $0.9990234$ (as in $p = P\{S \leq 9\}$ being computed using pbinom(9, 10, 0.5)
in R). I understand this is significant evidence to accept $H_0$ ("there is no evidence against the median being 20 or greater than 20", which I took to be equivalent to something like "according to the evidence we do have, the median is $\geq$ 20").
But the solution key provides the p-value as $p = 0.0107$. The key also gives the solution for this as being given by SIGN.test(data21a, md=20, alternative="greater")
, which I understand would entail having hypotheses $H_0: M \leq 20$ vs $H_A: M > 20$. And in that case the p-value would be $p = P\{S \geq 9\} = 1 - P\{S \leq 8\}$ or 1 - pbinom(8, 10, 0.5)
.
I'm quite confused regarding this. Can you generally ignore the equality case in a median Sign Test of $\geq$? Shouldn't the results be equal to the inverse probability of each other or is this a bad interpretation?
EDIT: I'd like to add that the original problem in the textbook is about somebody needing an internet provider that can deliver a median speed of "at least" 20 Mbps. So I understood the only undesirable case is if the sample provides evidence that "they are not able to provide a median speed of at least 20 Mbps". The median speed being exactly 20 seems perfectly acceptable.
EDIT 2: I also thought about it more and I realise that the p-value equation is basically the standard Binomal probability of "x successes over n trials". I computed the critical value $S_{obs}=9$ per the textbook by counting how many sample elements are $> 20$. When I compute the right-tail probability $P\{S \geq S_{obs}\}$ I understand that I am computing the "probability of seeing $\geq S_{obs}$ values that are $>20$ over $10$ trials". So I imagine you could adapt the problem to take a critical value $S_{obs}'$ as "the number of items $\geq 20$" and compute the "probability of seeing values that are $\geq 20$ over $10$ trials", which would then be the desired p-value for this question?