From | Roger Newson <roger.newson@kcl.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Signtest (statistics question) |
Date | Mon, 12 May 2003 15:31:02 +0100 |
At 14:02 12/05/03 +0000, Guillaume Frechette wrote:
Dear Statalisters: I have two variables x1 and x2 for which I want to test the null hypothesis x1 = x2 (let's say 2 sided at the 10% level). I would normally use Signtest which I believe takes x = x1 - x2 and compares x to a binomial with mean 1/2. Thus, if you have 5 observations, such that x can be written as the vector [1,2,3,4,5] you would reject the null. Now, add 1 million 0's to x and the Signtest (at least as it is implemented in Stata) would still reject the null. However, at an "intuitive" level, it seems to me that x1 and x2 are much more similar in the second case (with the million observations where they are exactly the same) than in the original case. My (very limited) understanding of the problem is that since the variables should be continuous, an x of 0 happens with zero probability. Is there a test which takes into account my "intuitive" understanding or is my intuition simply wrong? I apologize for the non-Stata question. Thanks in advance.As I understand it, the sign test in Stata works by calculating sign(x1-x2), which is 1 if x1>x2, 2 if x1<x2, and 0 if x1==x2, and then compares the number of positive differences with a binomial with n equal to the number of non-zero differences. Therefore, the sign test is testing a hypothesis about Pr(x1>x2|x1!=x2), ie the conditional probability that x1>x2 assuming that either x1>x2 or x1<x2, excluding the observations where x1==x2. In the real world of applied statistics, of course, there are no continuous variables, and it is safe to assume a non-zero probability that x1==x2. The sign difference sign(x1-x2) will therefore be "trinomial", or multinomial with 3 possible values, 1, -1 and 0. If we are only interested in the ratio of positives to negatives, then it makes sense to ignore the zeros.
© Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |