Kalkulator uji z satu proporsi
- p = proporsi sampel yang diamati
- p 0 = proporsi hipotetis populasi
- n = ukuran sampel
z-statistik: 0,55487
nilai p (satu sisi): 0,28949
nilai p (2 sisi): 0,57898
CI 95% = [ 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); }