From a family pack skittles, some of the colours of different skittles are counted:

  • 41 green,
  • 48 purple
  • 100 red
  • 63 yellow.

Now I want to test if the probabilty of green is equal to the probability of purple; H0: P(green) = P(purple).

  • How do I test this is R?
  • Do I use a chi square test?
  • $\begingroup$ Could you explain what you mean by "probability" in this context? For instance, if we were to draw one candy at random out of this pack, the probability of getting a green would equal $41/(41+48+100+63)$ and the probability of getting a purple would be similarly computed: it's obviously greater and the question is entirely trivial. $\endgroup$
    – whuber
    Oct 4, 2011 at 16:17
  • 1
    $\begingroup$ @whuber I suspect the question is the usual "Is this random chance or is there a systematic pro-Reddist conspiracy in the depths of the Skittle factory?" $\endgroup$
    – Fomite
    Oct 5, 2011 at 1:40
  • $\begingroup$ @Epi Probably, but it usually isn't fruitful to answer a question based on what one suspects it might mean. A great answer to a vague question can often confuse more than it helps. That's why I have invited Wimpey to clarify this. $\endgroup$
    – whuber
    Oct 5, 2011 at 1:52
  • $\begingroup$ I have solved my problem, and for those interested in the answer, here is my R I/O: x = c(41, 48) chisq.test(x, p=c(0.5, 0.5))$p.value [1]0:4580882. I hope this also clarifies my question, I am not sure how to formulate it in another way then I did before. Thanks for the help though. $\endgroup$
    – Wimpey
    Oct 5, 2011 at 14:18
  • 1
    $\begingroup$ For the record, Wimpey's solution in the comments above is incorrect and tests something completely different to what he/she originally asked. $\endgroup$ Jan 24, 2012 at 11:13


Browse other questions tagged or ask your own question.