|
PERCENTILEName:
The default method for computing percentiles in Dataplot is based on the order statistic. The formula is:
where
If p is < 1/(n+1), then X1 is returned. If p > n/(n+1), then XN is returned.
<SUBSET/EXCEPT/FOR qualification> where <y> is the response variable; <par> is a parameter where the computed percentile is stored; <value> is a parameter that specifies which percentile to compute (it is a percentage value between 0 and 100); and where the <SUBSET/EXCEPT/FOR qualification> is optional.
<SUBSET/EXCEPT/FOR qualification> where <y> is the response variable; <par> is a parameter where the computed percentile is stored; <value> is a parameter that specifies which percentile to compute (it is a percentage value between 0 and 100); and where the <SUBSET/EXCEPT/FOR qualification> is optional. With this syntax, the desired percentile is specified by entering the command
before entering the PERCENTILE command.
LET A = 50 PERCENTILE Y SUBSET TAG > 2
LET P100 = 90
The default method used by Dataplot described above is equivalent to method R6 of Hyndman and Fan. The description of the methods here will be in terms of the quantile q = p/100 where p is the desired percentile. The method advocated by Hyndman and Fan is R8. For the R8 method,
where
If q ≤ (2/3)/(n+(1/3)) the minimum value will be returned and if q ≥ (n-(1/3))/(n+(1/3)) the maximum value will be returned. Method R7 (this is the default method in R and Excel) is calculated by
where
If q = 1, then Xn is returned. The R6, R7, and R8 methods give fairly similar, but not exactly the same (particularly for small samples), results. For most purposes, any of these three methods should be acceptable.
R6 is equivalent to ORDER. ORDER is the default.
The specific percentile to compute is specified by entering the following command (before the plot command):
where <value> is a number in the interval (0,100) that specifies the desired percentile.
2015/02: Support for R7 and R8 methods
LET Y1 = NORMAL RANDOM NUMBERS FOR I = 1 1 100
LET A1 = 30 PERCENTILE Y1
The value -0.4613 is returned.
Program 2:
. Step 1: Read the data (from e-Handbook example)
.
read y
95.1772
95.1567
95.1937
95.1959
95.1442
95.0610
95.1591
95.1195
95.1065
95.0925
95.1990
95.1682
end of data
.
. Step 2: Compute the quantiles using different methods
.
let p100 = 90
.
let xpr6 = percentile y
let xpr6 = round(xpr6,4)
.
set quantile method r7
let xpr7 = percentile y
let xpr7 = round(xpr7,4)
.
set quantile method r8
let xpr8 = percentile y
let xpr8 = round(xpr8,4)
.
. Step 3: Print the results
.
print "Percentile with R6 method: ^xpr6"
print "Percentile with R7 method: ^xpr7"
print "Percentile with R8 method: ^xpr8"
The following output is generated.
Percentile with R6 method: 95.1981
Percentile with R7 method: 95.1957
Percentile with R8 method: 95.1972
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 06/05/2001 | ||||||||||||||||||