Page 1 of 1

Remove the curve throwers

Posted: Thu May 18, 2006 10:37 am
by neophyte
I'm trying to calculate a time average. I have a start time and end time. I'm trying to calculate how long it took to take a quiz for a group of quiz takers. The problem is that there are couple people "throwing the curve".
time (in seconds)
1
2
100
300
200
343
233
3400
340000
I would like to programatically remove the "curve throwers" before calculating the average.

How do you do it? Is there a Mysql function I should be using other than avg? Here's my exsisting query.

Code: Select all

"SELECT ROUND(AVG(endtime - starttime) ) AS total FROM respondents"

Posted: Thu May 18, 2006 10:47 am
by hawleyjr
Depends on how you want to do the curve?

Some curves remove a top and bottom percentile (Typically 10%) some curves (Olympics I believe) remove the best and worst (as for scoring goes)

Posted: Thu May 18, 2006 10:49 am
by neophyte
Lets say I want to remove the top and bottom 10%

Posted: Thu May 18, 2006 10:54 am
by hawleyjr
In PHP.

1. Determine how many results there are. (In an array)
2. Multiply total results by .1 and round up the next whole int.
3. Remove the value of number 2 from the front and back of the array of results sorted asc or desc.

Posted: Thu May 18, 2006 3:40 pm
by neophyte
That did it Hawley! Thanks...