So in this section, let's look at these expected value tables. Now remember, our example of the airway disease and smoking. We had our column totals there and we had our row totals. Think about it though, we had a total of 1249 patients. If we'd looked at everyone that smoked that was 72, that was a row title. If we looked at patients with COPD down the column, that was 248. If we multiply the row total by the column total and divide by the total number, we get 14.296. That is what we would expect for that specific position. Row total times column total divided by grand totals. And if we carry on for all four, these are the results that we would expect if the null hypothesis was true. If there was no associations. Peer proportions, what we would expect. And we have values for 14.296. Now you are gonna find decimal values in these expected values. Up until 943, so quite large values there. This was a mock study, it doesn't really exist, but the values that I chose here are quite big. So now, there is an equation that will work out the ch-square value for us. That'll be difference between the observed values and the expected values. That chi-square value is a test statistic. It's a sample statistic, and we're gonna plot it some way on some distribution, and it will work out for us what the probability was of finding the observed values that we did. Now there is one more issue at hand here and that again is the degrees of freedom. And the degrees of freedom as far as these chi-square contingency tables are concerned, is just you take the row total, how many rows there are, and here we had two rows. You subtract from that one, two minus one's one. You do the same for the columns, the total number of columns minus one. And this instance it will also be two minus one, one. One times one is one, so we have one degree of freedom. With that information, we can draw a graph. Now, I've got two examples for you here. You see a chi-squared distribution. And you'll also note that they do have a tail towards the right. They're not totally symmetrical. In the examples here, the first one in blue, the thin spiked one, that would be the graph with 2 degrees of freedom. And you see for 4 degrees of freedom how different it looks. So just the change of degrees of freedom makes a big difference. Now, that chi-square, that sample statistic, that only follows a chi-squared distribution as you see these plots here. Now we had values from 14 up to over 900, those are quite large numbers in the expected table. So we can expect our chi-squared test statistic really to follow a chi-square distribution. Now that's not always the case. Sometimes you have smaller samples. And when the expected values, all the values that you get in all the cells of the expected table are quite small, it really doesn't follow the chi-square distribution. And in those instances, we may have to make use of another test.