@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; }
words_text_area {
display:inline-block; color: black; font-family: Raleway; max-width: 550px; margin: 25px auto; line-height: 1.75; padding-left: 100px; }
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, input {
display: inline-block; vertical-align: baseline; width: 350px; }
#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; }
.label_radio { text-align: center; }
td, tr, th { border: 1px solid black; } table { border-collapse: collapse; } td, th { min-width: 50px; height: 21px; } .table_span_a, .table_span_b, .table_span_c, .table_span_d, .table_span_e { width: 100%; display: block; }
words_table {
color: black; font-family: Raleway; max-width: 350px; margin: 25px auto; line-height: 1.75; }
summary_table {
color: black; font-family: Raleway; max-width: 550px; margin: 25px auto; line-height: 1.75; padding-left: 20px; }
.label_radio { text-align: center; } Этот калькулятор однофакторного дисперсионного анализа сравнивает средние значения трех или более независимых выборок.
Просто введите значения для пяти образцов в ячейки ниже, затем нажмите кнопку «Рассчитать».
Образец 1
11, 12, 12, 14, 16, 19, 19, 20, 21, 21 Образец 2
16, 16, 16, 17, 18, 19, 22, 24, 25, 32 Образец 3
18, 18, 19, 21, 21, 22, 22, 23, 24, 26 Образец 4
Образец 5
| Источник | SS | дф | РС | Ф | п | | --- | --- | --- | --- | --- | --- | | Уход | 136,1 | 2 | 68,0 | 4.069 | 0,02853 | | Ошибка | 451,4 | 27 | 16,7 | | | | Общий | 587,5 | 29 | | | |
var div_table = document.getElementById('words_table');
function calc() { //define addition function function add(a, b) { return a + b; }
//get raw data for each group var group_a = document.getElementById('a').value.split(',').map(Number); var group_b = document.getElementById('b').value.split(',').map(Number); var group_c = document.getElementById('c').value.split(',').map(Number); var group_d = document.getElementById('d').value.split(',').map(Number); var group_e = document.getElementById('e').value.split(',').map(Number);
//verify they exist if (group_a.length < 2){ group_a = null}; if (group_b.length < 2){ group_b = null}; if (group_c.length < 2){ group_c = null}; if (group_d.length < 2){ group_d = null}; if (group_e.length < 2){ group_e = null};
//get summary stats of each group if (group_a != null) { var mean_group_a = math.mean(group_a); }; if (group_b != null) { var mean_group_b = math.mean(group_b); }; if (group_c != null) { var mean_group_c = math.mean(group_c); }; if (group_d != null) { var mean_group_d = math.mean(group_d); }; if (group_e != null) { var mean_group_e = math.mean(group_e); };
var all_groups_holder = group_a.concat(group_b, group_c, group_d, group_e); var all_groups = all_groups_holder.filter(function (el) { return el != null; }); var mean_all_groups = math.mean(all_groups); var count_all_groups = all_groups.length;
if (group_a != null) { var mean_group_a_diff = mean_group_a - mean_all_groups; } else { var mean_group_a_diff = 0;}; if (group_b != null) { var mean_group_b_diff = mean_group_b - mean_all_groups; } else { var mean_group_b_diff = 0;}; if (group_c != null) { var mean_group_c_diff = mean_group_c - mean_all_groups; } else { var mean_group_c_diff = 0;}; if (group_d != null) { var mean_group_d_diff = mean_group_d - mean_all_groups; } else { var mean_group_d_diff = 0;}; if (group_e != null) { var mean_group_e_diff = mean_group_e - mean_all_groups; } else { var mean_group_e_diff = 0;};
if (group_a != null) { var count_group_a = group_a.length; } else { var count_group_a = 0;}; if (group_b != null) { var count_group_b = group_b.length; } else { var count_group_b = 0;}; if (group_c != null) { var count_group_c = group_c.length; } else { var count_group_c = 0;}; if (group_d != null) { var count_group_d = group_d.length; } else { var count_group_d = 0;}; if (group_e != null) { var count_group_e = group_e.length; } else { var count_group_e = 0;};
if (group_a != null) { var flag_group_a = 1; } else { var flag_group_a = 0;}; if (group_b != null) { var flag_group_b = 1; } else { var flag_group_b = 0;}; if (group_c != null) { var flag_group_c = 1; } else { var flag_group_c = 0;}; if (group_d != null) { var flag_group_d = 1; } else { var flag_group_d = 0;}; if (group_e != null) { var flag_group_e = 1; } else { var flag_group_e = 0;};
var total_treatments = [flag_group_a, flag_group_b, flag_group_c, flag_group_d, flag_group_e].reduce(add, 0);
//find sum of squares total, treatment, and residual var ss_total = (all_groups.map(function(x) { return Math.pow(x-mean_all_groups, 2); })).reduce(add, 0);
var ss_treatment = Math.pow(mean_group_a_diff, 2)*(count_group_a) + Math.pow(mean_group_b_diff, 2)*(count_group_b) + Math.pow(mean_group_c_diff, 2)*(count_group_c) + Math.pow(mean_group_d_diff, 2)*(count_group_d) + Math.pow(mean_group_e_diff, 2)*(count_group_e);
var ss_residual = ss_total - ss_treatment; //find degrees of freedom df_total = count_all_groups - 1; df_treatment = total_treatments - 1; df_residual = df_total - df_treatment;
//find mean sum of squares var ms_treatment = ss_treatment / df_treatment; var ms_residual = ss_residual / df_residual;
//find f value and p value var f = ms_treatment / ms_residual; var p = 1 - jStat.centralF.cdf(f, df_treatment, df_residual);
//--------------OUTPUT RESULTS-----------// document.getElementById('ss_treatment').innerHTML = ss_treatment.toFixed(1); document.getElementById('ss_residual').innerHTML = ss_residual.toFixed(1); document.getElementById('ss_total').innerHTML = ss_total.toFixed(1);
document.getElementById('df_treatment').innerHTML = df_treatment.toFixed(0); document.getElementById('df_residual').innerHTML = df_residual.toFixed(0); document.getElementById('df_total').innerHTML = df_total.toFixed(0);
document.getElementById('ms_treatment').innerHTML = ms_treatment.toFixed(1); document.getElementById('ms_residual').innerHTML = ms_residual.toFixed(1);
document.getElementById('f').innerHTML = f.toFixed(3); document.getElementById('p').innerHTML = p.toFixed(5); }