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

FRIEDMAN TEST

Name:
    FRIEDMAN TEST
Type:
    Analysis Command
Purpose:
    Perform a Friedman test that k treatments are identical.
Description:
    The Friedman test is a non-parametric test for analyzing randomized complete block designs. It is an extension of the sign test when there may be more than two treatments.

    The Friedman test assumes that there are k experimental treatments (k ≥ 2). The observations are arranged in b blocks, that is

        Treatment
      Block 1 2 ... k
      1 X11 X12 ... X1k
      2 X21 X22 ... X2k
      3 X31 X32 ... X3k
      ... ... ... ... ...
      b Xb1 Xb2 ... Xbk

    Let R(Xij) be the rank assigned to Xij within block i (i.e., ranks within a given row). Average ranks are used in the case of ties. The ranks are summed to obtain

      R(j) = SUM[i=1 to b][R(X(ij))]

    Then the Friedman test is

    H0: The treatment effects have identical effects
    Ha: At least one treatment is different from at least one other treatment
    Test Statistic: T1 = 12/[b*k*(k+1)]*SUM[i=1 to k][(R(i) - b*(k+1)/2)**2]

    If there are ties, then

    T1 = (k-1)*SUM[i=1 to k][(R(i) - b*(k+1)/2)**2]/(A1 - C1)

    where

    A1 = SUM[i=1 to b][j=1 to k][R(X(ij))]**2

    C1 = b*k*(k+1)**2/4

    Note that Conover recommends the statistic

    T2 = (b-1)*T1/(b*(k-1) - T1)

    since it has a more accurate approximate distribution. The T2 statistic is the two-way analysis of variance statistic computed on the ranks R(Xij).

    Significance Level: alpha
    Critical Region: T2 > FPPF(ALPHA,K-1,(b-1)*(k-1))

    where F is the percent point function of the F distributuion.

    T1 > CHSPPF(ALPHA,K-1)

    where CHSPPF is the percent point function of the chi-square distribution.

    The T1 approximation is sometimes poor, so the T2 approximation is typically preferred.

    Conclusion: Reject the null hypothesis if the test statistic is in the critical region.

    If the hypothesis of identical treatment effects is rejected, it is often desirable to determine which treatments are different (i.e., multiple comparisons). Treatments i and j are considered different if

      |R(j) - R(i)| > TPPF(1-alpha/2,(k-1)*(b-1))*
SQRT[2*(b*A1 - SUM[j=1 to k][R(j)**2]/((b-1)*(k-1))]
Syntax:
    FRIEDMAN TEST <y> <block> <treat>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y> is the response variable;
                <block> is a variable that identifies the block;
                <treat> is a variable that identifies the treatment;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    FRIEDMAN TEST Y BLOCK TREATMENT
    FRIEDMAN TEST Y X1 X2
    FRIEDMAN TEST Y BLOCK TREATMENT SUBSET BLOCK > 2
Note:
    In Dataplot, the variables should be given as:

      Y BLOCK TREAT

      X11 1 1
      X12 1 2
      ... 1 ...
      X1k 1 k
      X21 2 1
      X22 2 2
      ... 2 ...
      X2k 2 k
      ... ... ...
      Xb1 b 1
      Xb2 b 2
      ... b ...
      Xbk b k

    If your data are in a format similar to that given in the DESCRIPTION section (i.e., you have colums Y1 to Yk, each with b rows), you can convert it to the format required by Dataplot with the commands:

      LET K = 5
      LET NBLOCK = SIZE Y1
      LET NTOTAL = K*NBLOCK
      LET BLOCK = SEQUENCE 1 K 1 NBLOCK
      LET TREAT = SEQUENCE 1 1 K FOR I = 1 1 NTOTAL
      LET Y2 = STACK Y1 Y2 ... YK
      FRIEDMAN TEST Y2 BLOCK TREAT
Note:
    The response, ranked response, block, and treatment are written to the file dpst1f.dat in the current directory.

    The treatment ranks and multiple comparisons are written to the file dpst2f.dat in the current directory. Comparisons that are statistically significant at the 95% level are flagged with a single asterisk while comparisons that are statistically significant at the 99% level are flagged with two asterisks.

Note:
    The Friedman test is based on the following assumptions:

    1. The b rows are mutually independent. That is, the results within one block (row) do not affect the results within other blocks.

    2. The data can be meaningfully ranked.
Default:
    None
Synonyms:
    None
Related Commands:
    ANOVA = Perform an analysis of variance.
    SIGN TEST = Perform a sign test.
    MEDIAN POLISH = Carries out a robust ANOVA.
    T TEST = Carries out a t test.
    RANK SUM TEST = Perform a rank sum test.
    SIGNED RANK TEST = Perform a signed rank test.
    BLOCK PLOT = Generate a block plot.
    DEX SCATTER PLOT = Generates a dex scatter plot.
    DEX ... PLOT = Generates a dex plot for a statistic.
    DEX ... EFFECTS PLOT = Generates a dex effects plot for a
Reference:
    "Practical Nonparametric Statistics", Third Edition, Wiley, 1999, pp. 367-373.
Applications:
    Analysis of Variance
Implementation Date:
    2004/1
Program:
        SKIP 1
        READ CONOVER.DAT Y BLOCK TREAT
        FRIEDMAN Y BLOCK TREAT
        
    The following output is generated.
                       FRIEDMAN TEST FOR TWO-WAY ANOVA
    
         1. STATISTICS
               NUMBER OF OBSERVATIONS              =       48
               NUMBER OF BLOCKS                    =       12
               NUMBER OF TREATMENTS                =        4
               FRIEDMAN TEST STATISTIC (ORIGINAL)  =    8.097345
               A1 (SUM OF SQUARES OF RANKS)        =    356.5000
               C1 (CORRECTION FACTOR)              =    300.0000
               FRIEDMAN TEST STATISTIC (CONOVER)   =    3.192198
    
         2. PERCENT POINTS OF THE F REFERENCE DISTRIBUTION
            FOR FRIEDMAN TEST STATISTIC
               0          % POINT    =    0.000000
               50         % POINT    =   0.8052071
               75         % POINT    =    1.435732
               90         % POINT    =    2.257744
               95         % POINT    =    2.891563
               99         % POINT    =    4.436786
               99.9       % POINT    =    6.882786
    
    
                  96.37845       % Point:     3.192198
    
         3. CONCLUSION (AT THE 5% LEVEL):
               THE        4 TREATMENTS DO NOT HAVE IDENTICAL EFFECTS
        

Date created: 2/3/2004
Last updated: 2/3/2004
Please email comments on this WWW page to alan.heckert@nist.gov.