




Studiuj dzięki licznym zasobom udostępnionym na Docsity
Zdobywaj punkty, pomagając innym studentom lub wykup je w ramach planu Premium
Ta strona nie jest widoczna w podglądzie
Nie przegap ważnych części!





Paper SP
SAS ® macros are designed to apply Grubbs, Ferguson and Hofer-Rickard methods to evaluate statistical outliers. All methods are applied to the same sample and results are compared. I. INTRODUCTION This paper describes SAS macros designed for several methods (Grubbs, Ferguson and Hofer- Rickard), evaluating observed analytical results that are different from those expected. Such results may be accurate measurements of the entity being measured and are termed atypical results (outliers). Sometimes, assignable causes for the atypical result cannot be found (e. g. calculation, instrumentation or analyst error). The 1998 FDA Draft Guidance for Industry “Investigating Out of Specification (OOS) Test results for Pharmaceutical Production” [Hofer-Rickard] states that outlier testing may be performed as a part of the investigation to determine, whether it is likely that an atypical result is due to an analytical mistake.
(assay)
Three outlier evaluation method macros are discussed:
These macros may be a useful tool in evaluation of test or experimental results, having values unexpectedly lower or higher than the rest of results. A brief discussion of these methods is provided below. All of these methods assume normal distribution of measurements. A number of methods can be used for a quick evaluation of distribution normalcy, like - 2 =< standard s kewness =< 2 and - 2 < standard kurtosis < 2. Grubbs method Grubbs [1,2] outlier approach assumes that all observations in a sample have normal distribution. In practical cases all the observations may be subject to the same standard error, while it may happen that the largest or smallest observations result from shifts in level. For instance, if one observation appears unusually high compared to the others in the sample, we may want to consider hypothesis that all observations com e from a normal parent with mean μ and standard deviation s, N(μ,s), against the alternative hypothesis that the largest observation comes from a normal population with mean μ+?s, ? > 0, and standard deviation s, while the remaining observations are from N(μ,s). Another case may involve the situation, where the largest or smallest observations may be from N(μ,?s),? > 0, while the remaining observations are from the normal parent N(μ,s). Grubbs proposes the following statistics to test significance of the largest observation in a sample size n from a normal population: n- 1 _ n _
i=1 i=
_ n- 1 _ n xn = 1/(n-1) sum(xi), x = (1/n)sum(xi) i=1 i= A similar statistics, S^21 /S^2 , can be used for testing whether the smallest observation is too low. For testing whether the two largest observations are too large, the statistics n- 2 _ n _ S^2 n-1,n/S^2 = sum(xi - xn-1,n)^2 / sum (xi – x)^2 (2) i=1 i= _ n- 2 xn-1,n = 1/(n-2) sum(xi) i= and a similar statistics, S^2 1,2/S^2 , can be used to test significance of the two smallest observations. Grubbs test applicability is limited by the calculated critical values in the paper itself, but is very suitable for small sample sizes (3-25 for statistics (1) and 4-20 for statistics (2)). The method allows evaluation simultaneously of two possible outliers in one method run. In case of larger samples, a suspected outlying observation(s) can be tested against a subset of a sample. Fergusson method F.E. Grubbs provides in [2] several methods to deal with sample outliers. One of them is a method published by Ferguson, cf. references in [2], based on sample skewness and kurtosis coefficients. Application of skewness coefficient is suggested for "one sided" tests and kurtosis is recommended for "two sided" tests. If skewness or kurtosis or both exceed significance levels, [2] then the observation farthest from the mean is rejected and the same procedure is repeated until no further samples are judged as outliers. The macro applies either skewness or kurtosis or both. Hofer-Rickard method Hofer and Rickard [3] conducted a simulation study, to determine sample sizes necessary to achieve a pre specified level of confidence of detection that the suspect result in question is a statistical outlier. Assume that a suspected outlying observation, I (initial), is detected. Hofer-Rickard method finds a number of additional observations required to classify I (outlier – yes or no). Next, the corresponding extreme studentized deviate (ESD) statistics value, with two-sided type I error either of 2% or 5% confidence, is calculated and compared with critical values, tabulated by Hofer-Rickard. Hofer-Rickard method requires estimate of the additional results standard deviation, S, and mean M. The degree of freedom associated with such an estimate is typically N-1, where N is the number of independent observations used to compute estimate. It is highly recommended, that both S and M are based on prior independent data. The normalized estimated distance of the initial result from the true mean, D, can be calculated as D = |M – I|/S (3) Based on values of D and the number of observations used to calculate S and M Rickard-Hofer tables allow finding the number of additional tests to be performed, with two-sided type I error either of 2% or 5% confidence. Two cases are considered: ♦ Prior to I sample data available (prior data sample deviation, SDprior^ , can be calculated or is known) ♦ No prior to I data available.
Hofer-Rickard macro %macro Hofer_Rickard(dsn_pre=, /* Input data set with (prior) to outlier observations / dsn_post=, / Input data set with (post) to outlier observations / /****** Should contain the suspected value ******/ var=, / Variable tested (assay) / int_out=, / Value of suspected outlier / exp_mean=, / Expected mean - if nonmissing, othervise calculated / exp_sd=, / Expected std - if nonmissing, otherwise calculated / select_pre=, / Selection of observations prior to (and excluding) an outlier / select_post=, / Selection of observations post (and excluding) an outlier / xls_smpl=, / Excel with prior sample size / xls_crit=, / Excel with H-R critical values / cnfdnce=, / Confidence level (2% or 5%) / err_rate=, / Error rate (2% or 5%) / out_dsn=, / Output data set / prt_obs=, / Request to print observations used, if nonmissing / add_obs_only=); / Prints the number of additional observations required only */
The following dataset is used (54 observations): { 100.1 99.2 100.2 100.3 100.5 9 8.4 99.6 99.5 98.4 97.3 97.9 99 100 99.8 99.2 97.6 9 9.2 99.5 99.7 99.3 97 99.3 99.4 98. 97.7 9 8.2 99 99.4 98.9 98.9 98.5 99.2 100.3 99.5 95.1 99. 98.9 99.2 97.8 97.8 97.1 98.6 99.1 98.4 97.9 98.7 98 .3 99. 98.2 98.2 98.4 97 94.8 94.8 } Suspected outliers: 94.8, 94.8. Grubbs test – simultaneous check on 2 and 1 possible outliers. The sample presented above is ordered from the smallest values to the largest, and then Grubbs macros are applied. For instance sample size 2 5 contains {94.8, 94.8, 95.1, 97, 97, 97.1, 97.3, 97.6, 97.7, 97.8, 97.8, 97.9, 97.9, 98.2, 98.2, 98.2, 98.2, 98.3, 98.4, 98.4, 98.4, 98.4, 98.5, 98.6, 98.7 }. Table 1. Grubbs tests for two consecutive suspect results. Outlier status Sample size Average Grubbs statistics 1 % 2. 5 % 5 % 10 % Not (an) outlier(s) 4 95.425 0.536006 0 0.0002 0.0008 0. Not (an) outlier(s) 5 95.74 0.449676 0.0035 0.009 0.0183 0. Not (an) outlier(s) 6 95.96667 0.40764 0.0186 0.0349 0.0565 0. Not (an) outlier(s) 7 96.15714 0.387305 0.044 0.0708 0.102 0. Not (an) outlier(s) 8 96.3375 0.384324 0.075 0.1101 0.1478 0.1 994 Not (an) outlier(s) 9 96.48889 0.383071 0.1082 0.1492 0.1909 0. Not (an) outlier(s) 10 96.62 0.383671 0.1415 0.1865 0.2305 0. Not (an) outlier(s) 11 96.72727 0.382417 0.1736 0.2212 0.2666 0. Not (an) outlier(s) 12 96.825 0.383461 0.2044 0.2536 0.2996 0.
Outlier status Sample size Average Grubbs statistics Table 3. Grubbs tests for one suspect result (the other is removed). Outlier status Sample size Average Grubbs statistics
Table 7. Ferguson tests for a single suspect results - 5% significance level. Outlier status Sample size Average Skewness Kurtosis Ferguson critical kurtosis NO 5 96.2 - 0.4304 1.225441 2. NO 10 96.92 - 1.21987 2.926098 3. YES 15 97.30667 - 1.54613 4.248557 4. YES 20 97.565 - 1.76521 5.294844 4. YES 25 97.776 - 1.81655 5.916916 4. YES 50 98.588 - 1.41616 5.644343 3. Hofer-Rickard macro – one suspect result Macro output: Hofer-Rickard outlier test - additional observations applied - including suspect result (=3) D statistics value = 8. Initial ESD outlier Hofer-Rickard Confidence Type I Outlier observation test value critical value level error rate status
Table 8. Dixon test results – 95% confidence. Sample size All 25 observations included - 94.8 is The first observation (94.8) excluded - second 94.8 is Two first observations (94.8) excluded, 95.1 is 3 - 10 Not an outlier Not an outlier An outlier 11 - 25 Not an outlier An outlier An outlier
The paper discusses SAS macros to evaluate test and/or experiment suspect measurements. Three methods are used to develop three different macros (Grubbs, Ferguson and Hofer-Rickard). Sample average values are essential compared to outlier value. Grubbs – simultaneous evaluation of both suspect results - (2.5%-10%) outliers (average range 96.91 – 97.27). If one suspect result is evaluated against the rest of the sample (the other is removed) – the average range is 97.08 – 97.47. If only one is evaluated, but the other stays in the sample, no outlier is detected. Ferguson method with 5% significance – both suspect results – average is 97.61, in case of only one suspect result (the other is removed), average is 97.30. Hofer-Rickard provided average 97.65 – only one suspect result is considered. The results are confirmed by application of the Dixon test, [4].
[1] Frank E. Grubbs, Sample Criteria for Testing Outlying Observations, Annals of Mathematical Statistics, vol. 21, 1950, pp. 27- 58 [2] Frank E. Grubbs, Procedures of Detecting Outlying Observations in Samples, Technometrics, vol. 11, No. 1, 1969, pp 1- 21 [3] Jeffrey D. Hofer, Eugene C. Rickard, A Guide to Determining Sample Sizes and Outlier Criteria in Analytical Investigations, Pharmaceutical Technology, March 2001, pp. 52- 66 [4] D. R. Rorabacher, “Statistical Treatment for Rejection of Deviant Values: Critical Values of Dixon’s “Q” Parameter and related Subrange Ratios at the 95% Confidence Level”, Analytical Chemistry, vol. 63, No.2, January 15, 1991