1 つの比例 z テスト電卓
- p = 観察されたサンプルの割合
- p 0 = 人口の仮説的な割合
- n = サンプルサイズ
Z 統計: 0.55487
p 値 (片側): 0.28949
p 値 (両側): 0.57898
95% CI = [ 0.2914 , 0.6486 ]
function calc() {
//get input values var p0 = +document.getElementById('p0').value; var p = +document.getElementById('p').value; var n = +document.getElementById('n').value;
//calculate stuff var z = (p-p0)/(Math.sqrt(p0*(1-p0)/n));
//calculate p-value if (z<0) { var p1 = jStat.normal.cdf(z, 0, 1); var p2 = p1*2; } else { var p1 = 1-jStat.normal.cdf(z, 0, 1); var p2 = p1*2; } //calculate C.I. var zCrit = Math.abs(jStat.normal.inv(.975, 0, 1)); var se = Math.sqrt(p*(1-p)/n); var low = p - (zCrit*se); var high = p - (-1*zCrit*se); //output probabilities document.getElementById('z').innerHTML = z.toFixed(5); document.getElementById('p1').innerHTML = p1.toFixed(5); document.getElementById('p2').innerHTML = p2.toFixed(5); document.getElementById('low').innerHTML = low.toFixed(4); document.getElementById('high').innerHTML = high.toFixed(4); }