[SOUND] The mayor of large metropolitan city has been receiving complaints about high gas prices in the city. This is complexing since the city doesn't have a gas tax that is added to the price. So the mayor has asked one of his staff to look into this matter. We have data on prices of regular unleaded gas on a day when the average for unleaded gas in the state was $2.79. We're going to test 5% level of significance to see if there is evidence to suggest that gas prices are higher in this city or not. So first of all we have to form our hypothesis. So what you see here is that we think the prices in this city is higher, or at least the citizens are saying. So they are saying it is higher than 2.79, and the null hypothesis therefore would be that mu is less than or equal to 2.79. So this is what we would call a right tail test. So remember the sign here always refers to the side of the curve that will have the rejection area in it. So in this case we're looking at 0.05. So what we're saying is that the significance level is 0.05. Therefore we are going to take a sample and we have done that. And if that sample falls in the tail area here, it means that it is too unlikely to be randomly chosen to be that way. There must be a cause for that, and that is why we will end up rejecting the null hypothesis. If our P value is very small and falls into the tail. On the other hand if you have a sample falls on this side of the tail. Then it is a possible random variation that you see from city to city. And it's not really an indication that this city is any different than any other city in the state. So now let's look at the data. So the data is being collected here. So we'll going to look at what is the mean, what is the standard deviation and the count and so on, so we can count the p-value. So the mean is simply the average for the values that we see here. So I'm going to use Ctrl+Shift down, click the entire thing, return, and right now it turns out to be 294. Now, 294 is slightly higher than 279, but as we have seen before, just because it's higher doesn't mean that these are statistically different. So we do the hypothesis testing to establish that at 5% level of significance. So let's go back to our data standard deviation is STDEV.S. I will pick this and then I will pick the entire range of the data and close the parenthesis. Count will tell me the number of data set that we have here. So we have 133 gas stations that we have collected data from. Level of Significance we said is was 0.05. Hypothesize Mean is 2.79, because on this day the price of gas in the state, average price of regular gas in the state was 2.79. So now I'm ready to calculate the t-value. So again, the t-value is x bar minus mu, divided by standard deviation, divided by square root of n. So now I'm going to use this formula right here and enter the actual representation of it here. So it would be is equal to parenthesis x bar is right here that's my sample mean minus Mu, that's my hypothesized mean is right here. Divided by, again another parenthesis, by the standard deviation which I have here, divided by this square root of n. And in this case is 133, counts is really my number of data sets. So this would be the equation that I have written on a corner about t. So, this represents all the values that goes into that equation, and t-value turns out to be 4.458. So again, looking at this from a perspective of our problem. Is that we think 2.79 is here, and if this is the normal distribution, we have found a sample on this day that falls 4.458 away from the mean. So you know already that is way into the tail. So even without really giving you the p-value if you're that far off, you are way into the tail. It's practically zero chances that would find this thing randomly, is so unheard of. That it probably will point to a cause, so it's not random. So I would end up rejecting, but let me just show you how we would calculate the p-value. And this is the one that I want you to pay attention to. When you are doing a right tail test, if I put the t.dist, just let me just show you what happens. If I put just t.dist and I put this value along with my degrees of freedom, which is 133 minus 1, and the last part is 1. You will get a very large number, why? Because this is returning this side. So this is 0.999999, the value you see here. So when you have a right tail test, you have to make sure that you enter this value as one minus. And then you get the value that is really small. Because it's one minus this, that you saw. So this is practically zero. So going back, our p-value is extremely small. If your p-value is small, you'll end up rejecting the null hypothesis in favor of the alternate. So citizens are right by saying that the gas prices in the city are higher than the state. And there should really be a reason why they're doing this if there is no city tax. Then the city manager needs to find out what is it that they are doing. This could be a case of price gouging for example, which is actually punishable. So this is how we would test this. Now again, I just wanted you to pay attention. That if this is a positive value, you're not getting a p-value that is 0.99999, you have to look at 1 minus.