- Home
- Tutorials
- Flash
- Intermediate
- Testing for Outliers in ActionScript 3.0 using Grubbs' Test
Testing for Outliers in ActionScript 3.0 using Grubbs' Test

Testing our Grubbs class
Kendall Park
I am a computer science major at Wheaton College (IL), currently enrolled in a mentoring course in ActionScript 3.0 (similar to an independent study) with two other CS majors and my favorite professor, Dr. VanDrunen, also known as Dr. VanDomination.
View all articles by Kendall Parkpackage {
import flash.display.*
public class Main extends MovieClip{
public function Main():void {
var dataSample:Array = [30, 171, 184, 201, 212,
250, 265, 270, 272, 289,
305, 306, 322, 322, 336,
346, 351, 370, 390, 404,
409, 411, 436, 437, 439];
//var outlier:int = Grubbs.findOutlier(dataSample, Grubbs.T_950);
trace("Outlier?: "+Grubbs.findOutlier(dataSample, Grubbs.T_950));
}
}
}
Here you can see that I've created a sample array of 25 data entries. Looking over the entries, we can probably guess that the value '30' is an outlier. But do what degree of certainty? Let's find out!
Every time Main() is called, the trace function will make a call to Grubbs.findOutlier(), and then print the result to the console. For my first test I will be using the array of t-distribution values at 95% certainty, indicated by Grubbs.T_950, which a constant variable hard-coded into the Grubbs class.
When run, the console prints:
Outlier?: 0
This means that the outlier lies at index 0. That's value '30', which we guess earlier was an outlier. But that's only 95% certainty that 30 is not part of a normal distribution. What if we wanted to be 99% sure?
I repeated the test, but replaced Grubbs.T_950 with Grubbs.T_990 (other t-distribution set of values I hard-coded into the Grubbs class). The console printed:
Outlier?: -1
Recall that our findOutlier() function returns '-1' if no outliers are found. This means that we cannot be 99% certain that the value '30' lies outside of normal distribution. (Though we can be 95% certain, as shown above!)
Well, that concludes this tutorial! Hope this helps some, in whatever random case you happen to need outlier elimination in ActionScript!
Spread The Word
5 Responses to "Testing for Outliers in ActionScript 3.0 using Grubbs' Test" 
|
said this on 16 Dec 2009 6:33:40 AM CDT
First off, thanks for the
1) You 2) If you write yo 3) Page 1 seems to h 4) Page 2 seems to have No |
|
said this on 16 Dec 2009 4:32:58 PM CDT
Thanks for your feedback!
:) |
|
said this on 17 Dec 2009 4:51:54 PM CDT
Great work Kendall. I see
|
|
said this on 28 Dec 2009 11:16:04 AM CDT
Pretty interesting articl
I think for this |
|
said this on 16 Jan 2010 6:40:09 AM CDT
Great content! Keep em co
But agree with sha |


Author/Admin)