# st: Re: Binomial Sign Test for Two Dependent Samples

 From Mike Lacy <[email protected]> To [email protected] Subject st: Re: Binomial Sign Test for Two Dependent Samples Date Mon, 17 Jan 2005 07:44:09 -0700

>Date: Fri, 14 Jan 2005 15:18:53 -0700
>From: Thomas Speidel <[email protected]>
>Subject: st: Binomial Sign Test for Two Dependent Samples

> Subject: st: Binomial Sign Test for Two Dependent Samples
>
> I am trying to create little program for a "Binomial Sign Test for Two
> Dependant Samples".
> This test is somewhere between a signrank test and a binomial. The
> computations are fairly simple:
>
> 1. Find the differences among the pairs
> 2. Ignore all null differences
> 3. Count the number of non-zero, non-missing differences (i.e. n)
> 4. Count the number of positive differences (call it x)
> 5. Compute: Binomial(n, k, 0.5)
>

If you would like to use built-in facilities to calculate this test (known more commonly, I think, as the McNemar test), note that this it is available in -mcc- and -symmetry- command. (See search McNemar)
The documentation and dialog boxes for both of these procedures uses the vocabulary of matched case-controls studies, which is quite a parochial way to describe this test. That being said, given data in the "wide" format, with x1 and y1 being variables that indicate success/failure on two trials for each subject subject, you can obtain the test statistic you desire with:

symmetry x1 y1
or
mcc x1 y1

-symmetry- automatically gives the exact (binomial) as well as asymptotic p-value

=-=-=-=-=-=-=-=-=-=-=-=-=
Mike Lacy
Fort Collins CO USA
(970) 491-6721 office

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/