0

relatively quick question regarding this course question:

Hearing about your brilliant success in working with M&Ms, Mars Inc. transfers you over to the Skittles department. They recently have had complaints about tropical Skittles being mixed in with original Skittles. You decide to conduct a frequentist analysis. If the findings suggest than more than 1% of sampled supposedly original Skittles are actually tropical you will recommend action to be taken and the production process to be corrected. You will use a significance level of \alpha = 0.1α=0.1. You randomly sample 300 supposedly original skittles, and you find that five of them are tropical. What should be the conclusion of your hypothesis test? Hint - H_0: p = 0.01H 0 ​ :p=0.01 and H_1: p > 0.01H 1 ​ :p>0.01.

Reject H_0H 0 ​ , since the p-value is equal to 0.027, which is less than \alpha = 0.1α=0.1

Fail to reject H_0H 0 ​ , since the p-value is equal to 0.245, which is greater than \alpha = 0.1α=0.1

Fail to reject H_0H 0 ​ , since the p-value is equal to 0.101, which is greater than \alpha = 0.1α=0.1

Fail to reject H_0H 0 ​ , since the p-value is equal to 0.184, which is greater than \alpha = 0.1α=0.1

By googling around, I know the answer can be discovered via "1-sum(dbinom(0:4, 300, 0.01".

My question is why is it only covering 0:4 and not 0:5 if 5 skittles were observed?

whuber
  • 281,159
  • 54
  • 637
  • 1,101
  • 3
    Good question. Maybe "Googling around" isn't a universally great way to find a correct answer to a homework problem. Why does your title refer to "Bayes" theorem while the question references a "frequentist analysis"? – whuber Dec 13 '18 at 20:04
  • Very fair comments. Largely because I'm taking a module of a course which is covering Bayes when this question came up. I know the Googled answer is accurate however. So I'm curious to understand why. – RichardMillington Dec 13 '18 at 20:36
  • 1
    Here are some hints: the critical region for the test consists of counts $5,6,7,\ldots, 300.$ What probability is computed by `sum(dbinom(0:4,300,0.01))`? Why is that subtracted from $1$? How does that compare to the (more perspicuous) calculation `pbinom(5-1, 300, 0.01, lower.tail=FALSE)` or even `sum(dbinom(5:300, 300, 0.01))`? If you're unsure, consult the help page for these functions with `?dbinom`. If these hints are just completely puzzling, then please check out our thread at https://stats.stackexchange.com/questions/31. – whuber Dec 13 '18 at 20:46
  • Thanks for this, i do really appreciate it. I have gone through the functions and tried going through the link you recommended, but there's a huge amount of content in here and I'm really looking for a pretty direct answer. I've spent hours searching around for just a pretty direct response to this question and coming up short. – RichardMillington Dec 13 '18 at 20:57
  • 1
    Frankly, every time I have to perform such calculations I go through the steps I outlined anyway just to make sure I am understanding the software correctly. I like to plot the results, too, so I can *see* they are what I expect. It's so easy to make a one-off error that it's important check one's work -- and `R` is decidedly inconsistent in its functional interface. You cannot rely on the behavior of one function to indicate how a similar one will act. It pays, therefore, to focus on the *underlying concepts* rather than memorizing what the software does. – whuber Dec 13 '18 at 21:04
  • Thanks again. To me, right now, it's not so much about understanding the software (or perhaps it is) as it is understanding why when there are five results above I'm only supposed to sum 4 of them. There's a gap in my knowledge here I'm struggling to fill by browsing for answers. – RichardMillington Dec 13 '18 at 21:07
  • 1
    That's what my previous reference to https://stats.stackexchange.com/questions/31 was intended to address. You seem to be asking why the critical region for this hypothesis test is the set $\{5,6,\ldots, 300\}.$ BTW, you are summing *five* values, not four! – whuber Dec 13 '18 at 21:10
  • Good point! So why is it summing 0:4 and not 0:5 ? Is there a simple answer? – RichardMillington Dec 14 '18 at 14:48
  • Yes, and I have already provided it: subtracting the sum of probabilities for $0$ through $4$ from $1$ is just a simpler way of *adding* all the probabilities for $5$ and larger values. – whuber Dec 14 '18 at 14:51

0 Answers0