Certainty of two comparative values (A/B results certainty)
The code below doesn't reproduce your code entirely, it just illustrates what I mentioned earlier in the comments:

function example() {
    var values = [0.0498673470,
                  0.0211410061,
                  0.0032776263,
                  0.0000380036,
                  0.0000488906,
                  0.0000053830];
    function sum(a, b) { return a + b; }
    function sqdiff(a, b) { return (b - a) * (b - a); }
    function avg(data) {
        return data.reduce(sum) / data.length;
    }
    function curry(f) {
        var args = [].slice.call(arguments);
        args.shift();
        return function () {
            return f.apply(null, args.concat([].slice.call(arguments)));
        };
    }
    function std(data) {
        var a = avg(data);
        return Math.sqrt(data.map(curry(sqdiff, a)).reduce(sum) / 
            data.length);
    }
    console.log("Standard deviation: " + std(values));
}


You, most likely, won't want to write functions like curry yourself though. There are libraries out there which already do such (and many more) useful things. I believe that Lodash already has one.