Hi, everybody, this is. Eugene Ole our connection computing at the National College of Ireland and welcome to my series of short how-to videos in this video. We want to learn how to perform a paired or dependent t-test, and we’re going to learn how to do it by hand. So before we start, let’s take a look at some sample data that we’re going to use in this t-test, let’s say. I want to run a training course, and I’ve given my students. There’s 14 students in my class. I’ve given them a test to test their knowledge before the course starts, and then after the course is complete. I give them a different test and so I’ve got a pre post test sets of scores here. I’ve got one group of students being tested twice. Therefore, I paired our dependence. T-test is an appropriate test to run here if I want to test. If there’s a statistically significant difference between the pre and the post test groups, so as always, let’s set out our null and alternative hypothesis here. So my 8-0 my null hypothesis. Is that the Mew? The mean of the pretest group is equal to the Mu of the post-test group. In other words, there’s no difference between the means. My alternate or research hypothesis here is that the Mu, The mean of the pretest group is not equal to the MU, The mean of the post-test groups. In other words, then the alternate hypothesis is that there is a difference between the two sets of test scores. And this tells me that. I’m going to be using a two-tailed test here. No direction is specified. I’m going to run this test at an alpha value equal to 0.05 five percent. And I’m going to determine my degrees of freedom by N minus one, so I’ve got 14 pairs of students pairs of test scores here, so that’s going to be 14 minus 1 to give us 13 degrees of freedom. Next thing I need to do is to consider the formulate. I’m going to use so appear at the top, right, My T statistic is equal to the sum of the capital T. So that’s the sum of the differences the capital T stands for the differences, So what I’m going to do is I’m going to add a continent extra column here for D for the differences, and that’s going to be the each of the sets of values subtracted from each other for each pair until I get down to the bottom over here. So that’s the sum of the differences divided by the square-root, so don’t forget the square root sign of N, which is my number of pairs, so that’s going to be 14 times. The sum of the D squared, so I now also need to calculate D squared, so I’m going to have an and second column to be added in here. Then I’m going to subtract from that. The sum of the D value, which I have up here to on the enumerator, squared and divide that by N minus one. So now let’s go ahead and determine what D and D squared are in our tests over here, so our first thing to do is amount for each pair. I’m going to subtract the first value from the second from the second value from the first value, so for the first pair, that’s 23 minus 35 which is equal to minus 12 and while. I have that number on my calculator. I go to squares and that gives me. My d squared value of 144 now. I move on to my next pair, So it’s going to be 25 minus 40 that gives me a value of minus 1 515 and while that’s on my calculator and called Square does, and that gives me 2 2 5 and then I move on to the third pair. That’s 28 minus 30 That’s equal to minus 2 and square it out again. That gives me a value of 4 and I keep doing this, then for each the rest of all the pairs until I get down to the bottom of the columns and fill up the second new column here as well so that I’ve got all my values listed here when I have that done, you should end up with a table. That looks like this here you can see. I have all my differences, my capital. D listed here and be very, very careful of the signs. You can see a lots and lots of minus signs in here. I’m going to be adding all of these up, So it’s important that I get the signs, correct? No sign problems when you square these values. So I’ve got all my D squared values here. We can see in our formula that we need to sum each of these two columns. So when I add up and all the DS here, I get an answer of minus 1 1 5 So the sum of the DS is sum of the D is equal to minus 1 1 5 and the sum of the D squared is going to add up All this column here. I get a result of 1513 so the sum of D Squared is equal to 1513 So these are the values that I now need to import into my formula up here, so let’s go ahead and do that, so I’m going to write out the formula again with each value listed so T My T statistic is equal to the sum of the DS, which is minus 1 1 5 and I divide that by the square root. I’ve got N times the sum of D squared, so when N is equal to 14 because I’ve got 14 pairs. So that’s going to be 14 multiplied by the sum of D Squared, which is 1513 and put that in a bracket. Then I’m going to subtract and again. The sum of the D which is the sum of D, which is minus 1 1 5 squared and I’m going to divide that by N minus 1 N is 14 so that’s going to be equal to 14 minus 1 so these here are the values plugged into my t-test formula so now that I just go and start to reduce this down a little bit, So T is equal to. I’m going to keep the top numerator at the top square root. I’m going to work out some of these bursts, So I’ve got 14 X at 1513 14 x 1 5 1-3 that’s equal to 20 1182 -, let me get the square of 1 1 5 – 1 1 5 and square that that’s equal to 13 thousand 2 2 5 and that’s going to be divided by 40 minus 1 which is 13 so my next formula then is – 1 1 5 divided by the square root of let’s work this out 20 1182 – one thousand thirteen thousand two, two five That’s equal to seven thousand nine hundred fifty-seven and the divide out by 13 gives me a value of six one two point zero seven, seven rounded. I need to take the square root of that value, so I’m going to do. I put this down here so in my last formula in fold will be the square root of six one two, so I have it on my calculator, So just do the square root of that, and that gives me twenty four point seven, four zero rounded and so work out the last value for T. So I’m going to do one one five, That’s a minus and divide that by twenty four point, seven four, it’s zero and which is equal to minus four point six four eight, So my T star has worked out with minus four point six four. H now the next thing I need to do now is I need a critical value to compare this test statistic to so look up a set of T tables. And this is my T distribution here, and you’ll call – my. I need to determine two things here. The first is my degrees of freedom, which I’ve already determined as thirteen. And what is the probability value here? So I have run the test at a probability value of 0.05 I mentioned earlier on, but because it’s a two-tailed test, I have to divide that by two. So my column that I’m going to be using here. Is 0.05 divided by two. Which is this middle column? The probability is 0.025 So when I go across my line here for 13 degrees of freedom, so there’s 13 degrees of freedom, and I then compare that then. To the column for 0.025 my critical value. My cheek rate is two point one six zero, so my T. Chris is equal to two point one six zero. Because I’ve got a minus T statistic over here. I want to be working in a left-tail so my T. Crit is going to have a negative sign and we can see here that my T stash is its greater than let’s go in the left tail. It’s going to be greater on my cheek rash and therefore. I’m going to reject h0 visually. Let me draw a t-distribution here in the center, But have it something like this you. In the center, here’s my rejection region at Alpha equal to 0.025 my T. Chris is here, which is equal to minus 2 0.16 0 My T stat will be. Let’s say I’d be somewhere around here. My T star is equal to minus 4 point 6 4 8 We can see that my. T statistic falls into the reject region as an alpha value of 0.025 Therefore, I reject the null hypothesis that there’s no difference between the two sets means in favor of the alternative hypothesis that there is a difference between the two sets of means a significance level of alpha equal to 0.05 So because this is in the left tail here. This is telling me as well that my pretest scores are less than my post test scores, but we have found a difference here. We have found a significant difference and therefore we can conclude that the course the training course that was conducted here made a difference to the knowledge of the students. Their post test scores were higher. So that’s how you conduct a pair. G test by hand. I hope you found this video useful. Thank you for your attention.