Калькулятор t-критерия для парных выборок

@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-тест для парных выборок, просто заполните информацию ниже и нажмите кнопку «Рассчитать». Образец 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,608761

дф = 22

p-значение (односторонний) = 0,060963

p-значение (двустороннее) = 0,121926

function calc() { //get raw data var raw1 = document.getElementById('rawData1').value.split(',').map(Number); var raw2 = document.getElementById('rawData2').value.split(',').map(Number);

//calculate paired differences var diff = []; for (var i = 0; i < raw1.length; i++) { diff.push(raw1[i]-raw2[i]); } console.log(diff); //calculate test statistic t var xdiff = math.mean(diff) var s = math.std(diff) var n = raw1.length; var df = n-1; var t = xdiff /(s/Math.sqrt(n));

//calculate p-value if (t<0) { var p1 = jStat.studentt.cdf(t, df); var p2 = p1*2; } else { var p1 = 1-jStat.studentt.cdf(t, df); var p2 = p1*2; }

document.getElementById('t').innerHTML = t.toFixed(6); document.getElementById('df').innerHTML = df; document.getElementById('p1').innerHTML = p1.toFixed(6); document.getElementById('p2').innerHTML = p2.toFixed(6); }