Are these paired samples correlated?

Paired samples are correlated when there is a relationship between the two samples. This means that when one value in the first sample changes, the value in the second sample also changes in a predictable way. If the two samples are not correlated, then changing the values in one sample will not affect the values in the other sample.

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

A paired samples t-test is used to compare the means of two samples when each observation in one sample can be paired with an observation in the other sample.
To perform a paired samples t-test, simply fill in the information below and then click the “Calculate” button.

Sample 1

Sample 2

t = -1.608761

df = 22

p-value (one-tailed) = 0.060963

p-value (two-tailed) = 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);
}

x