Калькулятор объединенной дисперсии

@import url('https://fonts.googleapis.com/css?family=Droid+Serif|Raleway');

.axis--y .domain { display: none; }

h1 { text-align: center; font-size: 50px; margin-bottom: 0px; font-family: 'Raleway', serif; }

p { color: black; margin-bottom: 15px; margin-top: 15px; font-family: 'Raleway', sans-serif; }

words {

color: black; font-family: Raleway; max-width: 550px; margin: 25px auto; line-height: 1.75; padding-left: 100px; }

words_calc {

color: black; font-family: Raleway; max-width: 550px; margin: 25px auto; line-height: 1.75; padding-left: 100px; }

words_calc input {

display: inline-block; vertical-align: baseline; width: 350px; max-height: 35px; }

hr_top {

width: 30%; margin-bottom: 0px; border: none; height: 2px; color: black; background-color: black; }

hr_bottom {

width: 30%; margin-top: 15px; border: none; height: 2px; color: black; background-color: black; }

words label, #words input {

display: inline-block; vertical-align: baseline; width: 350px; max-height: 35px; }

#buttonCalc { border: 1px solid; border-radius: 10px; margin-top: 20px; padding: 10px 10px; cursor: pointer; outline: none; background-color: white; color: black; font-family: 'Work Sans', sans-serif; border: 1px solid grey; /* Green */ }

#buttonCalc:hover { background-color: #f6f6f6; border: 1px solid black; }

words_output {

text-align: center; }

solution_div {

text-align: center; }

words_intro {

color: black; font-family: Raleway; max-width: 550px; margin: 25px auto; line-height: 1.75; }

words_table {

color: black; font-family: Raleway; max-width: 350px; margin: 25px auto; line-height: 1.75; }

.text_areas { color: black; font-family: Raleway; max-width: 350px; margin: 25px auto; line-height: 1.75; }

.label_radio { text-align: center; } При выполнении двухвыборочного t-критерия мы обычно предполагаем, что дисперсии между двумя выборками равны. При этом предположении мы можем рассчитать объединенную дисперсию для использования в двухвыборочном t-тесте. Чтобы рассчитать объединенную дисперсию для двух выборок, просто заполните информацию ниже, а затем нажмите кнопку «Рассчитать». Введите необработанные данные Введите сводные данные  Образец 1

301, 298, 295, 297, 304, 305, 309, 298, 291, 299, 293, 304 Образец 2

302, 309, 324, 313, 312, 310, 305, 298, 299, 300, 289, 294 с 1 (стандартное отклонение образца 1) n 1 (размер образца 1) с 2 (стандартное отклонение образца 2) n 2 (размер образца 2)  Объединенная дисперсия = 59,905303

//set summary table to hidden to start var summary_display = document.getElementById("summary_table"); summary_display.style.display = "none";

//find which radio button is checked function check() { if (document.getElementById('raw').checked) { var table_display = document.getElementById("words_table"); table_display.style.display = "block"; var summary_display = document.getElementById("summary_table"); summary_display.style.display = "none"; } else { var table_display = document.getElementById("words_table"); table_display.style.display = "none"; var summary_display = document.getElementById("summary_table"); summary_display.style.display = "block"; }

} //end check

//perform one-sample t-test function calc() { if (document.getElementById('summary').checked) { var s1 = +document.getElementById('s1').value; var n1 = +document.getElementById('n1').value; var s2 = +document.getElementById('s2').value; var n2 = +document.getElementById('n2').value;

var df = n1-(-1*n2)-2; var pooled = Math.sqrt(((n1-1)*Math.pow(s1,2) - (-1*((n2-1)*Math.pow(s2,2))))/df); var pooled2 = pooled*pooled;

document.getElementById('pooled').innerHTML = pooled2.toFixed(6); } else { var raw1 = document.getElementById('rawData1').value.split(',').map(Number); var raw2 = document.getElementById('rawData2').value.split(',').map(Number); var s1 = math.std(raw1); var n1 = raw1.length; var s2 = math.std(raw2); var n2 = raw2.length;

var df = n1-(-1*n2)-2; var pooled = Math.sqrt(((n1-1)*Math.pow(s1,2) - (-1*((n2-1)*Math.pow(s2,2))))/df); var pooled2 = pooled*pooled;

document.getElementById('pooled').innerHTML = pooled2.toFixed(6); }

//output results }