So this is the class where I risk losing you. But, I hope you'll see with me and see that the math really isn't so bad. We're only going to use a small amount of math to predict the future. Now, there's nothing that seems to be more satisfying to people than making predictions, especially when they turn out to be correct. But the math has some other useful properties later on that we will use when we investigate experiments. So I'm going to go back to the popcorn results from the prior class, 2A. And I've redrawn the cube plot here for you. By the end of this video you'll be able to predict the number of popcorn we get. The prediction has three parts. The first part, is the baseline amount of popcorn we expect. Then we're going to add to that the additional amount due to the cooking time, the "A factor"". And then there's the additional amount due to the popcorn type, the "B factor". I'm going to show you how to make predictions first, then go into the details of how we got these numbers, 67, 10 and 4. Recall that shorter cooking times and white corn both resulted in fewer number of popcorn. Let's try to predict the number of popped corn under these conditions. We start with the baseline value of 67, then the effect of 10 is multiplied by -1 because we're at short cooking times. And the effect of 4 is multiplied by -1 because we're using white corn. This gives a prediction of 53 popped corns. That's pretty close to the actual value of 52. Let's try making a prediction over here, at the top right hand corner, where we had both long cooking times and yellow corn. The prediction still has three plots. We add up our baseline value of 67 + 10 units due to the longer time with a +1 multiplier. And the additional 4 popcorns are due to multiplying by +1 for the corn type. We get a total value of 81. That's really a good prediction. Now where did these values come from? The baseline value of 67 is the easiest one to calculate. It's simply the average of the four values here on the cube. 52 + 74 + 62 + 80 and then divide that by 4 which is equal to 67. How did we get the value of 10? That is the effect of cooking time. Always go from high to low. The difference from high to low using yellow popcorn is 80 - 62. That's 18. The difference from high to low when using white popcorn is 74 - 52. That's 22. So 18 and 22: and the average of those two numbers is 20; and 20 tells us that is the increase number of popcorns, when we go from 160 seconds of cooking to 200 seconds. But, it's our convention that we don't report the 20. We actually report half the size, a value of +10. And that's where that "+10" comes from. So, if it's a 20 unit increase for every 40 seconds of cooking time, it's then a 10 unit increase for every 20 seconds of increased cooking time. Simply halve the values. You might already suspect why we use half the value. The reason is because we're jumping here from -1 to +1. And that's a leap of two units. It involves a step from -1 to 0, and then another step from 0 to +1. The reason why we halve is we'd rather the effect of a single step than a full two-step. Next, consider the effect of popcorn type. Again, always go from high to low. At long cooking times, this corresponds to 80 - 74. That's 6. At short cooking times, this is 62 - 52, which equals 10. The average of 6 and 10 is 8. So we conclude that an average of an 8 unit increase will happen when we change from white corn to yellow corn. We saw that in the previous class [2A]. Again, by convention, we report half the value. So in this case that's a 4 unit increase. So now you can see where we got these values of 67, 10 and 4. Now I know I haven't really spoken about what this xA and xB are. These are variables. Specifically we call them "coded variables" and in this area of work the word "code" means "to represent". So for example, in variable xB we let -1 represent white corn and we let +1 represent yellow corn. For xA the representation is similar. The -1 represents 160 seconds and the +1 represents 200 seconds. How would you represent a 190 seconds? There is a way to move from real world units to these coded units and I will show you that in a future class. Now I have another question for you. What is the prediction for the case when we were using white corn and a cooking time of 200 seconds? Feel free to pause the video and answer that question. I'll give you a hint if you are stuck. xA is coded as +1 for 200 seconds of cooking time, and xB is coded as -1 for white corn. So the prediction is 67 + 10 - 4 which gets you a value of 73. The final question: what is your prediction for white corn, and a cooking time of 180 seconds? Feel free to pause the video and review the previous part. The prediction is made here with xA = 0. That's our coding for 180 seconds. We showed in the previous part that 180 seconds is midway between 160 and 200. And so the coded value for xA is also halfway between -1 and +1, in other words, 0. A coded value for xB is -1 for white corn, and so, if we use all of that together now, we get 67 + 0 - 4. That gets us the prediction of 63 popped corns. Is this prediction reasonable? Well notice that 63 is a number that falls exactly midway between 52 and 74. So yes, this prediction makes perfect sense. I think that's enough for today's class. In the next class I'm going to fine-tune this model and add an extra term that's going to show us what interactions really mean.