2017-08-03 6 views
1

クロスフィルターreductioプラグインに標準エラーを実装する方法はありますか?私はどれがappriaticated役立ちます{SE}Crossfilter reductioプラグインを使用した標準誤差計算ですか?

除い中心傾向の尺度上のすべての値を取得します。..

var CFX = crossfilter([ 
 
\t \t { foo: 'one', bar: 1 }, 
 
\t \t { foo: 'two', bar: 2 }, 
 
\t \t { foo: 'three', bar: 3 }, 
 
\t \t { foo: 'one', bar: 4 }, 
 
\t \t { foo: 'one', bar: 5 }, 
 
\t \t { foo: 'two', bar: 6 }, 
 
\t \t ]); 
 
var fooDim = CFX.dimension(function(k){ return k.foo; }); 
 
var fooGrp = fooDim.group(); 
 

 
var stdDeviation = reductio() 
 
\t \t \t .sumOfSq(function(d) { return d.bar; }) 
 
\t \t \t .sum(function(d) { return d.bar; }) 
 
\t \t \t .avg(true) 
 
\t \t \t .count(true) 
 
\t \t \t .std(true) 
 
\t \t \t // How to implement Standard error 
 
stdDeviation(fooGrp); 
 
console.log('Standard Deviation:-',JSON.stringify(fooGrp.top(Infinity))); 
 
<script src="https://cdn.rawgit.com/crossfilter/reductio/0.5.4/reductio.min.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/crossfilter/1.3.12/crossfilter.min.js"></script>

答えて

1

平均値と標準誤差のような平均様なものは、おそらくで計算しなければなりません表示時間を削減するのではなく、 Reductioは、多くの人が期待しているので、平均計算を提供しますが、減算器で数と合計を維持し、表示時の平均を計算するほうがずっと優れています。

標準エラーでも同じと思います。標準偏差(reductio.std)をカウントの平方根で割って表示する場合、通常、グループの標準誤差を計算するだけです。

関連する問題