Program written, modified, or edited at StatSoft, Inc.}
randomaccess;
ReDim Array1(Ncases);
{user variable selection}
If 0 = SelectVariables1('Variable Selection', 1, 1, VarList1, Count1, 'Select One Variable') then
Stop;
{enter possible outlier}
If 0 = DisplayNumericInputBox ('Grubbs Test', 'Enter Suspected Outlier', suspect) then Stop;
{sums values of selected variable}
For i:= 1 to Ncases Do
Array1(i):= Data(i,Varlist1);
{calculates the mean}
ValMean (Array1, 1, Ncases, mean);
{calculates the standard deviation}
ValStDeviation (Array1, 1, Ncases, std);
{calculates t}
if suspect > mean then t := (suspect - mean)/std
else t := (mean-suspect)/std;
{User must select/appoximate number of data points}
N := DisplayListBox('Select Closest N from the List', '3|4|5|6|7|8|9|10|15|20|25|50|100', 1);
if N = 0 then Stop;
if N = 1 then C8 := 1.153;
if N = 2 then C8 := 1.463;
if N = 3 then C8 := 1.672;
if N = 4 then C8 := 1.822;
if N = 5 then C8 := 1.938;
if N = 6 then C8 := 2.032;
if N = 7 then C8 := 2.110;
if N = 8 then C8 := 2.176;
if N = 9 then C8 := 2.409;
if N = 10 then C8 := 2.557;
if N = 11 then C8 := 2.663;
if N = 12 then C8 := 2.956;
if N = 13 then C8 := 3.207;
{sets the values of a vector so that a scrollsheet can be made with summary information}
Dim A(4);
A(1) := mean;
A(2) := std;
A(3) := t;
A(4) := C8;
{Summary Scrollsheet}
scroll := NewScrollsheet (1, 4, A, 'Grubbs Test for Outliers at 5% Risk of False Rejection',
'Summary', 'Mean|Std.Dev.|Calculated T|Gubbs T');
{if the observations is considered an outlier by Grubbs test then t value will be red}
ScrollsheetSetHiliteColor (scroll, Red);
if t >C8 then ScrollsheetSetHilite (scroll,1,3,1)
else ScrollsheetSetHilite (scroll,1,3,0);| Back to List of Programs |
![[StatSoft]](../../../images/sssmall.gif)
2300 East 14th Street, Tulsa, OK 74104
Phone: (918) 749-1119; Fax: (918) 749-2217
e-mail: info@statsoft.com
©Copyright StatSoft, Inc., 1984-2004.
StatSoft, StatSoft logo, STATISTICA, SEWSS, SEDAS, Data Miner, SEPATH and GTrees are trademarks of StatSoft, Inc.