return the standard deviation
| 70 | } |
| 71 | // return the standard deviation |
| 72 | double KeyListOpsMethods::getSampleStddev() { |
| 73 | if (empty()) return NAN; |
| 74 | |
| 75 | double avg = getMean(); |
| 76 | double squareDiffSum = 0.0; |
| 77 | for (begin(); !end(); next()) { |
| 78 | double val = getColValNum(); |
| 79 | double diff = val - avg; |
| 80 | squareDiffSum += diff * diff; |
| 81 | } |
| 82 | return sqrt(squareDiffSum / ((float)getCount() - 1.0)); |
| 83 | } |
| 84 | |
| 85 | // return the median value in the vector |
| 86 | double KeyListOpsMethods::getMedian() { |