 Statistics and Excel. Correlation, random number generation example. Get ready, taking a deep breath, holding it in for 10 seconds, looking forward to a smooth soothing Excel. Here we are in Excel. If you don't have access to this workbook, that's okay because we'll basically build this from a blank worksheet. But if you do have access, there's three tabs down below. Example, practice, blank. Example, in essence, answer key. Practice tab having pre-formatted cells so you can get to the heart of the practice problem. The blank tab is a blank worksheet so we can practice formatting those cells within Excel as we work through the practice problem. Let's go to the example tab to get an idea of where we will be going, what we will be doing. We are looking at correlations once again, two different data sets to see if there's a mathematical relationship or correlation. Are the two data points moving together in some way, shape or form in other words? And if they are moving together, if there is a mathematical relationship, the logical next question would be, is there a cause and effect relationship? And if there is a cause and effect relationship, the next question would be, what's the causal factor in that relationship? We're going to start off this time by making two sets of data from just randomly generated numbers. And then we'll copy and paste that so we have static randomly generated numbers. We're going to notice that each of these data sets, if we were to make a histogram, are going to tend towards the uniform distribution. As we saw in prior sections when we looked at different types of distributions that are common. Uniform distribution, bell curve distribution, Poisson distribution, exponential distribution for examples. So because we use the random generate in each of those sets will tend towards a uniform distribution. We'll plot our statistics in terms of the mean standard deviation. We'll plot these two against each other to see these points in our scatter plot. And we want to then also just kind of recognize the relationship of random data to also what people often think of as random data. To do that, we'll make another data set which is closer to what people might imagine or what they often do when they're trying to come up with random numbers, which is to space the numbers out and you get a data set which looks kind of like this. So this is just to point out the difference between what random list generally kind of looks like, which is usually a lot more clumpiness of numbers. Then what we kind of think in our mind of what randomness will look like, which is this spaced out kind of thing where all the numbers have their own kind of little area. So if we were to try to make something random ourselves, we're probably more likely to do something like this as opposed to some actual randomness that would look more like that. But what we're looking for here is the relationship between the two data sets. And so whether they be random or spaced out somewhat like this, we had two different methods to create those data sets. So you would think that there's going to be a very low relationship for the regression line. And then we'll plot the correlation mathematically as well as well here and then we'll do it with Excel. Alright, let's go to the blank tab to get started. I'm going to format the entire worksheet this time doing that first selecting the triangle up top right clicking on the worksheet. And let's format the whole thing. And we're going to make it currency as we normally do. Negative numbers bracketed and red, no dollar sign, no decimals and say OK and click on OK. You can say it, you don't have to really say it, but you have to click on. And then we go to the home tab font group. I'm going to make the whole sheet and boldened. And so let's just add our data set. So first data set, we're going to say this. I'm just going to call it Rand one because they're generated from random numbers. And let's call this one Rand two. Going to select those two and go to the home tab font group. Make it black, make it white on the letters as is our typical header structure alignment. We can just center it. We don't really need to wrap it. Then I'm going to use our random number generator. I'm going to make a random numbers between one and 100. So this is going to be equal Rand and tab or actually Rand between and then tab. And the bottom number I'm going to say is one comma top number is 100. So give me random numbers between one and 100 closing it up and enter. And there we have it. So let's see. Let's make like, I don't know, 200 and some of these. Let's go down like 200 and something of these randomly generated numbers randomly generated. Let's go 216, which should be 215. If we take the header column out there, we have it. Boom, randomly generated. Let's just copy this whole thing over. I'm going to copy this and paste it over here for more random numbers randomly generated for number two. So these have all been randomly generated, but they're not connected to each other in any way. So you would think there would be a very low correlation between randomly generated one and randomly generated two, even though there are numbers between one and 100. Now, because this random generation changes every time I do something, I want to copy these two and put them over here and paste them just formulas only so that it doesn't keep shuffling around. And then I'm going to make a skinny C. Skinny CC. I made a skinny CC. See what I did with the C. I made it skinny. I'm going to go to the home tab font group. Let's make this black and white and alignment. And let's center this. Okay, so there's our data sets. So now let's do it over here and do our statistics for rand one header, rand two header. Let's format it the same formatting as we have here. So I'll select these two cells go to the home tab up top clipboard and paint brushy paint brush it right there. Actually, I should move it to the right. I'm going to cut this right click and cut it and move it to the right by pasting it right here. That's that's just doing the same thing by the way as moving it like this. Cutting and pasting is the same as basically doing that. All right, let's make a skinny F like that and then say that we want the mean. We want the standard deviation and that let's keep it at that mean and standard deviation. So this is going to be equal to the average, which is the mean.