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

DIFFERENCE OF QN

Name:
    DIFFERENCE OF QN (LET)
Type:
    Let Subcommand
Purpose:
    Compute the difference of the Qn scale estimates for two response variables.
Description:
    The Qn scale estimate is motivated by the Hodges-Lehmann estimate of location:

      HL = MEDIAN{(x(i) + x(j))/2; i < j}

    An analogous scale estimate can be obtained by replacing pairwise averages with pairwised distances:

      MEDIAN{|x(i) - x(j))|;  i < j}

    This estimate has high efficiency for normal data (86%), but a breakdown point of only 29%. Rousseeuw and Croux proposed the following variation of this statistic:

      Qn = d{|x(i) - x(j)|; i < j}(k)

    where d is a constant factor and k = (h choose 2) which is approximately (n choose 2)/4 . The value of h is [n/2]+1 (i.e., roughly half the number of obserations). In other words, we take kth order statistic of the (n choose 2) interpoint distances. The value of d is choosen to make Qn a consistent estimator of scale. We use the value 2.2219 since this is the value that makes Qn a consistent estimator for normal data.

    Enter HELP QN SCALE for a more detailed discussion of the Qn scale estimate.

    For the difference of Qn scale estimates, the Qn scale estimate is computed for each of the two samples then their difference is taken.

Syntax:
    LET <par> = DIFFERENCE OF QN <y>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y> is the response variable;
                <par> is a parameter where the computed difference of Qn scale estimates is stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET A = DIFFERENCE OF QN Y1
    LET A = DIFFERENCE OF QN Y1 SUBSET TAG > 2
Note:
    Dataplot uses code provided by Rousseeuw and Croux to compute the Qn estimate. This algorithm uses an efficient computational method for computing Qn.
Note:
    The Rousseeuw and Croux article also proposes the Sn scale estimate. The article discusses the properties of both estimators in detail.
Note:
    In addition, the Qn statistic is supported for the following plots and commands

      DIFFERENCE OF QN PLOT Y X
      CROSS TABULATE DIFFERENCE OF QN PLOT Y X1 X2
      BOOTSTRAP DIFFERENCE OF QN PLOT Y
      JACKNIFE DIFFERENCE OF QN PLOT Y

      TABULATE DIFFERENCE OF QN Y X
      CROSS TABULATE SN Y X1 X2
      LET Z = CROSS TABULATE DIFFERENCE OF QN Y X1 X2

Default:
    None
Synonyms:
    None
Related Commands:
    QN SCALE = Compute the Qn scale estimate of a variable.
    SN SCALE = Compute the Sn scale estimate of a variable.
    DIFFERENCE OF MAD = Compute the difference of the median absolute deviations between two variables.
    DIFFERENCE OF IQ RANGE = Compute the difference of iq ranges between two variables.
    DIFFERENCE OF SD = Compute the difference of standard deviations between two variables.
    DIFFERENCE OF SN = Compute the difference of the Sn scale estimates between two variables.
    STATISTIC PLOT = Generate a statistic versus subset plot.
    CROSS TABULATE PLOT = Generate a statistic versus subset plot (two subset variables).
    BOOTSTRAP PLOT = Generate a bootstrap plot for a statistic.
Reference:
    "Alternatives to the Median Absolute Deviation", Peter J. Rousseuw and Christophe Croux, Journal of the American Statistical Association, December, 1993, Vol. 88, No. 424, pp. 1273-1283.

    "Data Analysis and Regression: A Second Course in Statistics", Mosteller and Tukey, Addison-Wesley, 1977, pp. 203-209.

Applications:
    Data Analysis
Implementation Date:
    2003/4
Program:
    SKIP 25
    READ IRIS.DAT Y1 TO Y4 X
    .
    LET A = DIFFERENCE OF QN Y1 Y2
    TABULATE DIFFERENCE OF QN Y1 Y2 X
    .
    MAJOR XTIC MARK NUMBER 3
    MINOR XTIC MARK NUMBER 0
    XTIC OFFSET 0.2 0.2
    X1LABEL GROUP ID
    Y1LABEL DIFFERENCE OF QN
    CHARACTER X
    LINE BLANK
    DIFFERENCE OF QN PLOT Y1 Y2 X
    CHARACTER X ALL
    LINE BLANK ALL
    BOOTSTRAP DIFFERENCE OF QN PLOT Y1 Y2 X
        
    Dataplot generated the following output.
           **************************************
           **  LET A = DIFFERENCE OF QN Y1 Y2  **
           **************************************
      
      
     THE COMPUTED VALUE OF THE CONSTANT A             =  0.43340060E+00
      
      
           *****************************************
           **  TABULATE DIFFERENCE OF QN Y1 Y2 X  **
           *****************************************
      
      
                     *    Y1       AND Y2
         X           *    DIFFERENCE OF QN
     **********************************************
         1.00000     *   -0.506639E-06
         2.00000     *    0.206496
         3.00000     *    0.206497
        

    plot generated by sample program

    plot generated by sample program

Date created: 5/21/2003
Last updated: 5/21/2003
Please email comments on this WWW page to alan.heckert@nist.gov.