-----LP LOCATION (LET)-------------------------------
 
LP LOCATION
 
Name:
    LP LOCATION (LET)
 
Type:
    Let Subcommand
 
Purpose:
    Compute a Lp-norm based location estimate for a variable.
 
Description:
    Mosteller and Tukey (see Reference section below) define
    two types of robustness:

      1) resistance means that changing a small part, even by a
         large amount, of the data does not cause a large change
         in the estimate

      2) robustness of efficiency means that the statistic has
         high efficiency in a variety of situations rather than
         in any one situation.  Efficiency means that the estimate
         is close to optimal estimate given that we distribution
         that the data comes from.  A useful measure of efficiency
         is:

              Efficiency = (lowest variance feasible)/
                           (actual variance)
   
    Many statistics have one of these properties.  However,
    it can be difficult to find statistics that are both
    resistant and have robustness of efficiency.

    For location estimaors, the mean is the optimal estimator
    for Gaussian data.  However, it is not resistant and it
    does not have robustness of efficiency.  The median is
    a resistant estimate, but it has only moderate robustness
    of efficiency.

    The Lp location estimator is both resistant and
    robust of efficiency.  Mosteller and Tukey recommend using
    the median for exploratory work where moderate efficiency
    in a variety of situations is adequate and the biweight
    in situations when high performance is needed.

    The Lp location estimate is defined as:

       y* = SUM[i=1 to n][w(i)*y(i)]/SUM[i=1 to n][w(i)]

    where 

      w(i) = (1 - ((y(i)-y*)/(c*S))**2)**2  for (Y(i)-y*)/(c*S)**2 < 1
           = 0                              otherwise

      S = median{|y(i) - y*|}

      c = 6  (using 6 means that residuals up to approximately
             4*sigma are included)

   Note that this is an iterative estimate since y* depends on
   w(i) and w(i) depends on y*.

   Dataplot will compute up to 10 iterations (computation is
   terminated if the Lp location estimate does not
   change in value by more than 0.000001).

Syntax:
    LET <par> = LP LOCATION <y>
                      <SUBSET/EXCEPT/FOR qualification>
    where <y> is the response variable;
          <par> is a parameter where the computed Lp location
               is stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
 
Examples:
    LET A = LP LOCATION Y1
    LET A = LP LOCATION Y1 SUBSET TAG > 2
 
Note:
    Support for the Lp location has been added to the 
    following plots and commands:

       LP LOCATION PLOT
       BOOTSTRAP LP LOCATION PLOT
       JACKNIFE LP LOCATION PLOT
       CROSS TABULATE LP LOCATION PLOT
       DEX LP LOCATION PLOT
       LP LOCATION INFLUENCE CURVE

       LET Y2 = CROSS TABULATE LP LOCATION Y X1 X2

       SET LOCATION STATISTIC LP LOCATION
       LET Y2 = STANDARDIZE Y X1 X2
    
Default:
    None
 
Synonyms:
    None
 
Related Commands:
    BIWEIGHT SCALE             = Compute a biweight scale estimate of
                                 a variable.
    BIWEIGHT CONFIDENCE LIMITS = Compute a biweight based confidence
                                 interval.
    MEAN                       = Compute the mean of a variable.
    MEDIAN                     = Compute the median of a variable.
    MIDMEAN                    = Compute the midmean of a variable.
    TRIMMED MEAN               = Compute the trimmed mean of a
                                 variable.
    WINSORIZED MEAN            = Compute the Winsorized mean of a
                                 variable.
    AVERAGE ABSOLUTE DEVIATION = Compute the average absolute
                                 deviation of a variable.
    MEDIAN ABSOLUTE DEVIATION  = Compute the median absolute
                                 deviation of a variable.
    STANDARD DEVIATION         = Compute the standard deviation of a
                                 variable.
    VARIANCE                   = Compute the variance of a variable.
    RANGE                      = Compute the range of a variable.
 
Reference:
    "Data Analysis and Regression: A Second Course in Statistics",
    Mosteller and Tukey, Addison-Wesley, 1977, pp. 203-209.

Applications:
    Robust Data Analysis
 
Implementation Date:
    2001/11
 
Program 1:
    LET Y1 = NORMAL RANDOM NUMBERS FOR I = 1 1 100
    LET Y2 = LOGISTIC RANDOM NUMBERS FOR I = 1 1 100
    LET Y3 = CAUCHY RANDOM NUMBERS FOR I = 1 1 100
    LET Y4 = DOUBLE EXPONENTIAL RANDOM NUMBERS FOR I = 1 1 100
    LET A1 = LP LOCATION Y1
    LET A2 = LP LOCATION Y2
    LET A3 = LP LOCATION Y3
    LET A4 = LP LOCATION Y4
 
Program 2:
    SKIP 25
    READ GEAR.DAT DIAMETER BATCH
    TITLE AUTOMATIC
    XLIMITS 1 10
    MAJOR XTIC MARK NUMBER 10
    MINOR XTIC MARK NUMBER 0
    XTIC OFFSET 1 1
    X1LABEL BATCH
    Y1LABEL LP LOCATION OF DIAMETER
    LP LOCATION PLOT DIAMETER BATCH
 
Program 3:
    LET Y = CAUCHY RANDOM NUNBERS FOR I = 1 1 200
    TITLE AUTOMATIC
    BOOTSTRAP LP LOCATION PLOT Y
    X1LABEL B025 = ^B025, B975=B975
    TITLE BOOTSTRAP OF LP LOCATION: CAUCHY RANDOM NUMBERS
    HISTOGRAM YPLOT
 
