Howdy! I'm Professor Curtis of Aspire Mountain Academy here with more statistics homework help. Today we're going to learn how to perform the runs test for randomness with law enforcement fatalities. Here's our problem statement: Listed below from left to right and then top to bottom are numbers of law enforcement fatalities for 20 recent and consecutive years. First, find the mean, identify each value as being above the mean (A) or below the mean (B). Then test randomness above and below the mean using alpha equals 0.05. Is there a trend?
OK, here we have our data. And the first part of the problem is asking for the mean of these data. So let's go ahead and dump that data into StatCrunch. So here we have the data now loaded into StatCrunch. So we're going to go to Stat --> Summary stats --> Columns. Here in my options window, I select the column where my data can be found. And then I want to select the mean. Now I'm ready to go get it. And here it is. We're not asked to round to any number of digits. In fact, the instructions specifically say do not round. So I won't. Nice work!
Now the next part wants us to determine the null and alternative hypotheses. This is pretty much set for runs tests for randomness. So here we're going to have an alternative --- excuse me, a null hypothesis that says the data are going to be in a random order. And then of course the alternative hypothesis will be the alternative to that, which is that the data are in an order that's not random. Good job!
Now the next part wants us to find the test statistic. And to do this we need to figure out what our sample sizes are. So let's go ahead and do the categorization that was mentioned here in the promise statement . So every one of these values that is above the mean, I'm going to categorize with an A. And everyone that is below, I'm going to categorize with B. So now I just need to go through and categorize each one of these values in turn.
Well, 158 is just barely above the mean and 157 just a little bit below the mean. This is the kind of thing that a computer is really adept at doing . And that's why, you know, I wish that some of this functionality had been programmed into StatCrunch, because, I mean, it's really not that hard to do the --- I don't think it would be that hard to do, and you wouldn't have to do all this manual labor. I mean, come on, it's the 21st century.
OK, so here we've got all of our categorizations done. Now we just got to do the counting. So how many As do we have? One, two, three, four, five, six, seven, eight, nine, ten As. And we've got one, two, three, four, five, six, seven, eight, nine, ten Bs. 10 and 10. So 10 is below 20, so both of our sample sizes are less than 20. And we've got a 5% significance level here, so that means we can use the number of runs as our test statistic. So how many runs do we have? Well, let's find out here. We've got one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve; I see 12 runs. So that's going to be my test statistic. Excellent!
Now we're asked to determine the P value and --- Oh, OK, here I just noticed something here. I've got an error in my --- do I have an error? It looks like, yeah, I do have an error. 163 is actually above the mean value, so I need to replace that with capital letter A. OK, so that's going to change my counts to 9 and 11. We're still --- both numbers are still less than 20, so we're good here with the test statistic, but now we got got to get the P-value. And to get the P-value from StatCrunch, we first have to calculate our Z score test statistic. And to do that we've got to do this manual hand calculation, the old school way looking at all of these. Oh my gosh! It's just a behemoth of an equation.
Anywho, let's get to it. So let's see. What are our values? We got g, which is the number of runs; that's 12. And then we've got our sample sizes, which are going to be 9 and 11. Then we just substitute those values into our equation, and we simplify, and we punch into a calculator and out comes our Z score test statistic of 0.510807. And the decimal just keeps going on and on and on and on and on and on.
So now I can take that number, come back into StatCrunch, and I'm going to select Stat --> Calculators --> Normal. Here in my normal calculator, I want to select the Between option because we need a two tailed test. And then here I just put in that Z score test statistic that I just calculated. And I'm not going to take all those decimal places; four should suffice. Whoops, it helps to put in the right number. Then I just press Compute!, and out comes the area in between the tails. The P-value is the area inside the tails, so I need to take that number, and I'm going to subtract it from one. So one minus the area in between the tails gives us the area outside the tails. And this --- or excuse me, the area of the tails, and this is our P-value right here, which we're asked to round the six decimal of, excuse me, three decimal places. Nice work!
Now the next part wants us to determine a conclusion for our hypothesis test. With such a high P-value, we're going to be well above our significance level. So that means we're outside the reason of rejection. Therefore, we failed to reject the null hypothesis. Whenever we fail to reject the null hypothesis, there is not sufficient evidence.
But what is there not sufficient evidence of? What is there not sufficient evidence for? Well, we failed to reject the null hypothesis, so there's not sufficient evidence to side with the alternative hypothesis, which we see here is saying that the data are not in random order. So that's what we're going to put here. They're in an order that's not random. Fantastic!
And now the last part of this problem asks, "What do the results suggest?" Well, if we can't conclude that the data are in a random order, then we're supposing that the data are in a random order. That's what we --- that's why we failed to reject the null hypothesis, because it's potentially true. It's potentially true the data are in a random order. And so if there's a random order, that means there's no trending. And if there's no trending, that means the values are scattered above and below the mean value. Nice work!
And that's how we do it at Aspire Mountain Academy. Be sure to leave your comments below, and let us know how good a job we did or how we can improve. And if your stats teacher is boring or just doesn't want to help you learn stats, go to aspiremountainacademy.com, where you can learn more about accessing our lecture videos or provide feedback on what you'd like to see. Thanks for watching! We'll see you in the next video.
Frustrated with a particular MyStatLab/MyMathLab homework problem? No worries! I'm Professor Curtis, and I'm here to help.