SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Contacts SED Projects SED Products and Publications Search SED Pages

Dataplot Vol 1 Auxiliary Chapter


SIGN TEST

Name:
    SIGN TEST
Type:
    Analysis Command
Purpose:
    Perform a one sample or a paired two sample sign test.
Description:
    The t-test is the standard test for testing that the difference between population means for two paired samples are equal. If the populations are non-normal, particularly for small samples, then the t-test may not be valid. The sign test is an alternative that can be applied when distributional assumptions are suspect. However, it is not as powerful as the t-test when the distributional assumptions are in fact valid. It can also be applied in the case where there is no quantitative scale, but it is possible to order the data (i.e., an ordinal scale). Dataplot states the sign test in terms of medians, but it can also be expressed in terms of means.

    To form the sign test, compute di = Xi - Yi where X and Y are the two samples. Count the number of times di is positive, R+, and the number of times it is negative, R-. If the samples have equal medians and the populations are symmetric, then R+ and R- should be similar. If there are too many positives (R+) or negatives (R-), then we reject the hypothesis of equality. Ties are excluded from the analysis. Since there are only two choices (+ or -) for di the test statistic for the sign test follows a binomial distribution with p=0.5.

    Note that the binonial distribution is discrete, so the significance level will typically not be exact.

    More formally, the hypothesis test is defined as follows.

      H0: u1 = u2
      Ha: u1u2
      u1 < u2
      u1 > u2
      Test Statistic: S- = BINCDF(R-,0.5,N)
      S+ = BINCDF(R+,0.5,N)
      where BINCDF is the cumulative distribution for the binomial distribution, R- is the number of minus signs (i.e., di < 0), R+ is the number of plus signs (i.e., di > 0), and N is the sample size excluding ties between the samples.
      Alpha: Typically set to .05. Due to the discreteness of the binomial distribution, the actual significance level will not in most cases be exact.
      Critical Region: S+ < alpha: one sided test: U1 < U2
      S- < alpha: one sided test: U1 > U2
      alpha/2 < S+ < 1 - alpha/2: two sided test: U1 = U2
      Conclusion: Reject the null hypothesis (or, equivalently, accept the alternative hypothesis) if the test statistic is in the critical region.

    Although the above discussion was in terms of a paired two sample test, it can easily be adapted to the following additional cases:

    1. For the one sample case that the population mean is equal to a value d0, simply compute di = xi - d0 and calculate R+ and R- based on di.

    2. For the paired two sample case where we want to test that the difference between the two population means is equal to d0, compute di = xi - yi - d0 and calculate R+ and R- based on di.
Syntax 1:
    SIGN TEST <y1> <mu>             <SUBSET/EXCEPT/FOR qualification>
    where <y1> is a response variable;
                <mu> is a number or parameter that is the hypothesized mean value;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax implements the one sample sign test.

Syntax 2:
    SIGN TEST <y1> <y2>             <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax implements the two sample paired sign test where the hypothesized difference between the population means for the two samples is zero.

Syntax 3:
    SIGN TEST <y1> <y2> <mu>             <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
                <mu> is a number or parameter that is the hypothesized difference between the means of the two samples;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    SIGN TEST Y1 0
    SIGN TEST Y1 Y2
    SIGN TEST Y1 Y2 MU
    SIGN TEST Y1 Y2 SUBSET TAG > 2

    This syntax implements the two sample paired sign test where the hypothesized difference between the population means for the two samples is not equal to zero.

Note:
    DATAPLOT automatically prints the test statistic for both the one sided and two sided tests.
Note:
    Dataplot saves the following internal parameters after a sign test:

      STATVALP = R+, i.e., the number of plus signs
      STATVALM = R-, i.e., the number of minus signs
      STATVALP = S+, i.e., BINCDF(R+,0.5,N)
      STATVALM = S-, i.e., BINCDF(R-,0.5,N)
      CUTLOW90 = BINPPF(0.05,0.5,N)
      CUTUPP90 = BINPPF(0.95,0.5,N)
      CUTLOW95 = BINPPF(0.025,0.5,N)
      CUTUPP95 = BINPPF(0.975,0.5,N)
      CUTLOW99 = BINPPF(0.005,0.5,N)
      CUTUPP99 = BINPPF(0.995,0.5,N)
Default:
    None
Synonyms:
    None
Related Commands:
    T-TEST = Compute a t-test.
    SIGNED RANK TEST = Compute a signed rank test.
    CHI-SQUARED 2 SAMPLE TEST = Compute a two sample chi-square test.
    BIHISTOGRAM = Generates a bihistogram.
    QUANTILE-QUANTILE PLOT = Generate a quantile-quantile plot.
    BOX PLOT = Generates a box plot.
Reference:
    "Statistical Methods", Eigth Edition, Snedecor and Cochran, 1989, Iowa State University Press, pp. 138-140.
Applications:
    Confirmatory Data Analysis
Implementation Date:
    1999/5
    2000/8: bug fix for 2-sided interval. Was actually calculating a 90% interval rather than a 95% interval.
Program:
    SKIP 25
    READ NATR332.DAT Y1 Y2
    SIGN TEST Y1 Y2

    The following output was generated.

     
                TWO SAMPLE (PAIRED) SIGN TEST
     H0: TWO POPULATION MEDIANS ARE EQUAL
     SAMPLE SIZE                        =       10
     NUMBER OF POSITIVE DIFFERENCES     =        3
     NUMBER OF NEGATIVE DIFFERENCES     =        4
     SIGN TEST STATISTIC CDF VALUE (R+) =   0.5000000
     SIGN TEST STATISTIC CDF VALUE (R-) =   0.7734375
      
                            ALTERNATIVE-                   ALTERNATIVE-
     ALTERNATIVE-           HYPOTHESIS                     HYPOTHESIS
     HYPOTHESIS             ACCEPTANCE INTERVAL            CONCLUSION
     MEDIAN1 <> MEDIAN2     R+: (0,0.025), R-: (0,0.025)   REJECT
     MEDIAN1 < MEDIAN2      (R+) (0,0.05)                  REJECT
     MEIDAN1 > MEDIAN2      (R-) (0,0.05)                  REJECT
        

    Date created: 6/5/2001
    Last updated: 2/1/2005
    Please email comments on this WWW page to alan.heckert@nist.gov.