DavidHartleyPearsonTest (FPScript)

21.09.2021

Carries out a David-Hartley-Pearson outlier test. The test checks whether the highest or lowest value in the normally distributed sample passed belongs to the sample or not.

Syntax

DavidHartleyPearsonTest(Sample, ErrorProbability, Result)

 

The syntax of the DavidHartleyPearsonTest function consists of the following parts:

Part

Description

Sample

Contains the sample to be examined with at least 3 values and a maximum of 1000 values.

Permitted data structures are data series und signal. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

ErrorProbability

Specifies the error probability, on which the test is to be based, as a percentage. Here, the values 0.5, 1, 2.5, 5 and 10 % are permitted.

Permitted data structures are scalar value. All numeric data types are permitted. The argument is transformed to the unit %.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Result

Determines the result of the function.

The argument Result can have the following values:

Constant

Meaning

TEST_RESULT

The test result is the output.

TEST_REMOVE_OUTLIER

The sample is output with all outliers set to void. In this case, the test is repeated using the remaining values until no more outliers can be found.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

The sample must originate from a normally distributed population.

The result is either an integral value, which represents the test result, or the sample cleaned of outliers with a 64-bit floating point value data type. The values recognized as being outliers are marked as void.

In the first case, the following values are possible:

Value

Interpretation

0

The hypothesis was rejected. The lowest or highest value is, with the error probability specified, an outlier.

1

The hypothesis was accepted. The lowest and highest values are, with the error probability specified, not outliers.

2

No result could be determined, since the sample size is outside the valid range.

Available in

Option Enhanced Statistics

Examples

DavidHartleyPearsonTest({36, 37, 39, 39, 40, 40, 41, 41, 41,42, 44, 46}, 1 %, TEST_RESULT)
 

Results in 1s. The quotient from the difference between the largest and smallest value of the data series and the standard deviation is smaller than the quantile of the David-Hartley-Pearson test.

Q = R / s = (46 - 36) / Sqrt(Variance({36, 37, 39, 39, 40, 40, 41, 41, 41,42, 44, 46}) < 4.13 = Q12,0.99

Thus, neither the smallest nor the largest value is an outlier when the error probability is one percent.

See Also

GrubbsBeckTest Function

Outlier Test Analysis Object

Statistics Option

References

[1] "Hartung, Joachim": "Statistik (Statistics), 9th Edition", page 344. "Oldenbourg Verlag GmbH, Munich",1993.ISBN 3-486-22055-1.

[2] "David, H.A., Hartley, H.O., Pearson, E.S.": "The distribution of the ratio, in a single normal sample, of range to standard deviation". In: "Biometrika, vol. 41", page 491. 1954.

Share article or send as email:

You might be interested in these articles