经验法则计算器
经验法则(有时称为 68-95-99.7 规则)指出,对于具有正态分布的给定数据集:
68%的数据值在平均值的一个标准差之内。
95%的数据值在平均值的两个标准差之内。
99.7%的数据值落在平均值的三个标准差范围内。
要将经验法则应用于给定的数据集,只需在下面的框中输入数据集的平均值和标准差,然后单击“计算”按钮即可。
function calc() {
//get input data var pop_mean = document.getElementById('pop_mean').value*1; var pop_sd = document.getElementById('pop_sd').value*1;
//output values document.getElementById('one').innerHTML = "Approximately 68% of data values lie between " + (pop_mean-(pop_sd*1)).toFixed(3) + " and " + (pop_mean-(-pop_sd*1)).toFixed(3) + ""; document.getElementById('two').innerHTML = "Approximately 95% of data values lie between " + (pop_mean-(pop_sd*2)).toFixed(3) + " and " + (pop_mean-(-pop_sd*2)).toFixed(3) + ""; document.getElementById('three').innerHTML = "Approximately 99.7% of data values lie between " + (pop_mean-(pop_sd*3)).toFixed(3) + " and " + (pop_mean-(-pop_sd*3)).toFixed(3) + ""; }