In this lesson, I'm going to show you how to find a p-value from a t-test statistic using the calculator, the t-table table, and Excel. And I'll show you by going through a few examples. The first example we're going to look at is the average ACT score in Illinois, which is a 20.9.
There's one high school in particular that believes that their students scored significantly better than the state average . So in order to test their hypothesis, they took a random sample of 15 students' scores. They get an average of 22.5, with a standard deviation of 2.3. And because they believe that their students performed better, this is an upper tail test.
Now, again, ask yourself the question, what type of data am I dealing with? In this case, we're dealing with quantitative data, and we do not know the population standard deviation. Just the sample standard deviation, so I'm going to do a t-test.
I went ahead and I calculated the t-score for us, and I plotted it on our student's t-distribution. So we have a t score of 2.694. In order to convert that into a p-value, I'm going to show you the first method, which is on your graphing calculator.
So on your calculator, go ahead and hit 2nd DIST. And we're interested in this fifth function, which is TCDF, stands for t cumulative density function.
Go ahead and enter in your values. When you're entering in your values a TCDF, it is always going to be lower boundary of the shaded region, upper boundary of the shaded region, and then your degrees of freedom, because we know that the shape of this distribution changes with the sample size.
So in this case, the lower boundary of my shaded region is 2.694 comma. The upper boundary is the top portion of my distribution, which is positive infinity. And in order to indicate positive infinity to our calculator, we just do a positive 99. And then our degrees of freedom will be 14, because our sample size was 15. So for this particular problem, we have a p-value of 0.0087, or 0.87%.
Next, I'm going to show you how to use the t-table. Now, I'm going to show you how to use a t-table to get our p value. Now, tables sometimes can only get us an estimated p value. They can't get us an exact p-value, like the calculator or Excel. But sometimes it's all we have, and it's definitely sufficient enough.
So in this case, remember I had a t-test statistic of 2.694. So all of these values in your t-table, they're a bunch of t-scores. On my left hand column, these are my degrees of freedom, and this row at the top are all of my corresponding p-values.
So what we're going to do is you're going to look for the corresponding degrees of freedom for your hypothesis test. And in this case we had 14 degrees of freedom. And in this row, I'm going to look for the closest thing possible to my t-score, which was a 2.694.
Now, it falls in between these two values. And these t-scores correspond to these two p-values, 1% and 0.5%. Since it falls somewhere in the middle, I'm actually just going to take the average of these two p-values. So I'm going to take my 1% plus my 0.5% divide that by 2 and I get an estimated p value of 0.0075, or 0.75% when using the t-table.
To convert our t-test statistic into a p-value using Excel, I'm going to go under my Formulas tab. And I'm going to insert a formula that falls under the Statistical column. And I'm looking for t-distribution dot rt, because we're performing a right tail test.
Notice, how there is no t-distribution dot lt, because if you're performing a left tail test, you would just use the t-distribution distribution. But since we're performing an upper tail test, I'm going to use that function. And the first thing I'm going to put in is my t-score, which was a positive 2.694 comma 14 degrees of freedom. Hit Enter, and notice how I get the same p value I did when we used our calculator.
In this example, we're going to be looking at the quality assurance of a soda company that wants to make sure that their machines are working in filling their 12 ounce cans of pop. Now, because it would be a problem if their machines were significantly over filling and under filling their cans of pop, they need to perform a two-sided test. So they took a random sample of 10 cans of they're soda off their production line, and they got an average of 11.8 ounces, with a standard deviation of 1.2 ounces.
We're looking at quantitative data, which is the ounces of soda, and we do not know the population standard deviation. Therefore, we're going to perform a t-test. So I went ahead and I calculated our t-test statistic, which is negative 0.527, and I plotted it on our student's t-distribution.
So using our calculator to go from the t-score to a p-value, we're going to look again at TCDF. So go to 2nd, DIST, and we are going to scroll down to TCDF, which stands for t cumulative density function. And we're going to put in lower boundary of the shaded region comma upper boundary of the shaded region comma degrees of freedom.
So the lower boundary of my shaded region for this problem is negative infinity. And in order for the calculator to recognize negative infinity, we put in a negative 99 comma. The upper boundary of my shaded region is my t-score, which is a negative 0.527. And I have nine degrees of freedom, because my sample size was 10. And I get a corresponding p-value of 0.305, or 30.5%.
But this is not our final answer, this was a two-sided test, and this is only the p-value that's associated with this left tail, this left shaded region. I have to get the corresponding upper tail as well, which would fall at a positive 0.527. Luckily, because these two areas are equal, all I have to do is take this p-value that I got my calculator, and times it by two. So my p-value for this problem is 61.1%.
Now, I'm going to show you how to do this on the t-table. Now, to get the p-value from my t-test statistic of a negative 0.527, remember, we're going to look at the corresponding degrees of freedom, which in this case was a 9, and I'm going to find the closest t score I can to what I calculated. The closest value I have is this 0.703. There's nothing that I can estimate. I can't take an estimate between two values, because our t-score falls below the very first value.
So this corresponds to a p-value of 0.25, or 25%. But remember, that's just corresponding to one side of my student's t-distribution, so I have to times that value by 2, because we're doing a two-sided test. And I get a p-value of 0.5, or 50%, which is my estimate when using the t-table.
To convert our t-score into a p-value using Excel, I'm going to go under the Formulas tab, and I'm going to insert my formula again under the Statistical column. But because this is a two-sided sided test, I want t-distribution dot 2t, for two tails. Even though the t-square that we calculated was negative 0.527, in Excel you always put the positive tail. I'm not exactly sure why the Excel won't accept the negative t-score when using this function, but for whatever reason it doesn't. So we're going to go ahead and put in the positive 0.527 with our degrees of freedom, and notice how we get the same p-value value that we did when using our calculator.