Kalkulator interval keyakinan
Kalkulator ini membuat interval kepercayaan untuk rata-rata populasi menggunakan rumus berikut:
Interval kepercayaan = x +/- z*(s/√ n )
Emas:
- x : mean sampel
- z : nilai z yang sesuai dengan tingkat kepercayaan
- s: deviasi standar sampel
- n: ukuran sampel
Untuk membuat interval kepercayaan suatu mean populasi, cukup isi nilai di bawah ini lalu klik tombol “Hitung”:
Interval kepercayaan 90%: ( 5.896 , 28.104 )
Interval kepercayaan 95%: ( 3.770 , 30.230 )
Interval kepercayaan 99%: ( -0,388 , 34,388 )
function calc() {
//get input degrees of freedom, t-value var mean = document.getElementById('mean').value*1; var sd = document.getElementById('sd').value*1; var n = document.getElementById('n').value*1;
//define z-scores to use var z_90 = 1.645; var z_95 = 1.96; var z_99 = 2.576;
//calculate intervals var low_90 = mean - (z_90 * (sd/(Math.sqrt(n)))); var high_90 = mean - (-1*(z_90 * (sd/(Math.sqrt(n)))));
var low_95 = mean - (z_95 * (sd/(Math.sqrt(n)))); var high_95 = mean - (-1*(z_95 * (sd/(Math.sqrt(n)))));
var low_99 = mean - (z_99 * (sd/(Math.sqrt(n)))); var high_99 = mean - (-1*(z_99 * (sd/(Math.sqrt(n)))));
//output values document.getElementById('low90').innerHTML = low_90.toFixed(3); document.getElementById('high90').innerHTML = high_90.toFixed(3);
document.getElementById('low95').innerHTML = low_95.toFixed(3); document.getElementById('high95').innerHTML = high_95.toFixed(3);
document.getElementById('low99').innerHTML = low_99.toFixed(3); document.getElementById('high99').innerHTML = high_99.toFixed(3); }