How to calculate critical value for a sign test

710 Views Asked by At

I would like to use the sign test on some data in R, I know how to do this however how would i calculate the critical value of the data? If I don't know het distribution of the data what command should I use to get the critical value ? Do I use qnorm(alfa/2) or do I use qt or can't I calculate the critical value if I don't know the distribution?

1

There are 1 best solutions below

1
On BEST ANSWER

Comment: Here is a quick example with output from Minitab. If this is not the kind of data, $H_0,$ and $H_a$ you have in mind, then please be clear about what changes need to be made in order to help with the sign test you have in mind.

Data Display 

x
     7    16    23    28    55    70    87    92   129   160

Sign Test for Median 

Sign test of median =  20.00 versus > 20.00

     n  Below  Equal  Above       P  Median
x   10      2      0      8  0.0547   62.50

In R, under $H_0,$ the exact binomial probability of 8 or more 'Above', $P(A \ge 8) = 1 - P(A \le 7),$ is the P-value:

1 - pbinom(7, 10, .5)
[1] 0.0546875

Using a normal approximation to $\mathsf{Binom}(10, .5),$ you can get the critical value $7.6$ for a "5% level" test:

qnorm(.95, 5, sqrt(10/4))
[1] 7.600742

The quotes are because it is not possible to have a test exactly at the 5% level using the discrete binomial distribution. This difficulty is "swept under the rug" using a normal approximation.