Konfidenzintervall für einen standardabweichungsrechner
- n: Stichprobengröße
- s 2 : Stichprobenvarianz
- X 2 : kritischer Wert des Chi-Quadrats mit n-1 Freiheitsgraden
95 %-KI = [ 5,0637 , 8,8119 ]
function calc() {
//get input values var n = +document.getElementById('n').value; var s = +document.getElementById('s').value; var conf = +document.getElementById('conf').value;
var s2 = Math.pow(s,2); var df = n-1; var confUse = 1-conf; var confOut = conf*100;
var x2high = jStat.chisquare.inv(confUse/2, df); var x2low = jStat.chisquare.inv(1-(confUse/2), df);
//calculate stuff var low = Math.sqrt(df*s2/x2low); var high = Math.sqrt(df*s2/x2high);
//output results document.getElementById('confOut').innerHTML = confOut; document.getElementById('confOut2').innerHTML = confOut; document.getElementById('low').innerHTML = low.toFixed(4); document.getElementById('low2').innerHTML = low.toFixed(4); document.getElementById('high').innerHTML = high.toFixed(4); document.getElementById('high2').innerHTML = high.toFixed(4); }