Is Cronbach’s Alpha Calculator

@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;
}

Cronbach’s Alpha is a way to measure the of a survey or questionnaire.

Cronbach’s Alpha ranges between 0 and 1, with higher values indicating that the survey or questionnaire is more reliable.

To calculate Cronbach’s Alpha for a given survey or questionnaire, simply enter the responses for up to five questions into the boxes below, then press the “Calculate” button.

Responses to Question 1

Responses to Question 2

Responses to Question 3

Responses to Question 4

Responses to Question 5

Cronbach’s Alpha: 0.77344

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};

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;
});

//find total number of groups (k)
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 k = [flag_group_a, flag_group_b, flag_group_c, flag_group_d, flag_group_e].reduce(add, 0);

//find sum of variances (si2)
if (group_a != null) { var var_group_a = jStat.variance(group_a,true); } else { var var_group_a = 0;};
if (group_b != null) { var var_group_b = jStat.variance(group_b,true); } else { var var_group_b = 0;};
if (group_c != null) { var var_group_c = jStat.variance(group_c,true); } else { var var_group_c = 0;};
if (group_d != null) { var var_group_d = jStat.variance(group_d,true); } else { var var_group_d = 0;};
if (group_e != null) { var var_group_e = jStat.variance(group_e,true); } else { var var_group_e = 0;};

var si2 = [var_group_a, var_group_b, var_group_c, var_group_d, var_group_e].reduce(add, 0);

var jump = all_groups.length / k;

//find sum of row total variances (sy2)
let row_totals = [];
for (let i = 0; i < group_a.length; i++) {
row_totals[i] = [all_groups[i], all_groups[i+jump], all_groups[i+jump*2]].reduce(add, 0);
}
var sy2 = jStat.variance(row_totals,true);

//compute Cronbach's Alpha
var alpha = (k/(k-1))*((sy2-si2)/sy2);

//output Cronbach's Alpha
document.getElementById('alpha').innerHTML = alpha.toFixed(5);
}

x