Zwei-proportionen-z-test-rechner
- p = gesamter gepoolter Anteil
- p 1 = Anteil der Stichprobe 1
- p 2 = Anteil der Stichprobe 2
- n 1 = Stichprobengröße 1
- n 2 = Stichprobengröße 2
Z-Statistik: 0,31917
p-Wert (einseitig): 0,37480
p-Wert (2-seitig): 0,74960
function calc() {
//get input values var p1 = +document.getElementById('p1').value; var n1 = +document.getElementById('n1').value; var p2 = +document.getElementById('p2').value; var n2 = +document.getElementById('n2').value;
//calculate stuff var pool = (p1*n1 - (-p2*n2))/(n1-(-1*n2)); var z = (p1-p2)/(Math.sqrt(pool*(1-pool)*(1/n1-(-1/n2))));
//calculate p-value if (z<0) { var p1out = jStat.normal.cdf(z, 0, 1); var p2out = p1out*2; } else { var p1out = 1-jStat.normal.cdf(z, 0, 1); var p2out = p1out*2; } //output probabilities document.getElementById('z').innerHTML = z.toFixed(5); document.getElementById('p1out').innerHTML = p1out.toFixed(5); document.getElementById('p2out').innerHTML = p2out.toFixed(5); }