1 / 31

M&Ms Two-way Tables

M&Ms Two-way Tables. Ellen Gundlach STAT 301 Course Coordinator Purdue University. M&Ms Color Distribution % according to their website. Skittles Color Distribution % according to their hotline. My M&Ms data in counts. My M&Ms data: joint % (divide counts by total = 76).

paige
Download Presentation

M&Ms Two-way Tables

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. M&Ms Two-way Tables Ellen Gundlach STAT 301 Course Coordinator Purdue University

  2. M&Ms Color Distribution % according to their website

  3. Skittles Color Distribution % according to their hotline

  4. My M&Ms data in counts

  5. My M&Ms data: joint %(divide counts by total = 76)

  6. My M&Ms data: marginal %s for color (add down the columns)

  7. My M&Ms data: marginal %s for flavor (add across the rows)

  8. My M&Ms data: joint and marginal %s

  9. Conditional distribution of flavor for color • We know the color of our M&M already, but now how is flavor distributed for this color?

  10. Conditional distribution example • We know we have a red M&M, so what is the probability it is a plain M&M?

  11. Conditional distribution of color for flavor • We know the flavor of our M&M already, but now how is color distributed for this color?

  12. Conditional distribution example • We know we have a peanut M&M, so what is the probability it is green?

  13. Conditional distributions in general Conditional distribution of X for Y (we know Y for sure already, but we want to know the probability or % of having X be true as well):

  14. Bar graphs for conditional distribution of color for both flavors

  15. Chi-squared hypothesis test H0: There is no association between color distribution and flavor for M&Ms. Ha: There is association between color distribution and flavor for M&Ms. Use an  = 0.01 for this story.

  16. Full-class M&Ms data in counts(large sample size necessary for test)

  17. Chi-squared test SPSS results

  18. Chi-squared test conclusions • Test statistic = 14.396 and P-value = 0.013 • Since P-value is > our  of 0.01, we do not reject H0. • We do not have enough evidence to say there is association between color distribution and flavor for M&Ms.

  19. Skittles vs. M&Ms • Now we will compare the proportion of yellow candies for Skittles and for M&Ms. • The previous two-way table with plain and peanut M&Ms was of size 2 x 6. • This table will be of size 2x2 because we only care about whether a candy is yellow or non-yellow.

  20. Full-class M&Ms and Skittles data in counts(large sample size necessary for test)

  21. Chi-squared hypothesis test H0: There is no association between color distribution and flavor for these candies. Ha: There is association between color distribution and flavor for these candies. Use an  = 0.01 for this story.

  22. Chi-squared test SPSS results

  23. Chi-squared test conclusions • Test statistic = 11.839 and P-value = 0.001 • Since P-value is < our  of 0.01, we reject H0. • We have evidence that there is association between color distribution and flavor for these candies.

  24. Another way to do this test Since this is a 2x2 table, and if we are only interested in a 2-sided () hypothesis test, we can use the 2-sample proportions test here.

  25. 2-sample proportion test hypotheses H0: pM&Ms = pSkittles Ha: pM&Ms  pSkittles

  26. Defining the proportions

  27. Test statistic

  28. Results from the proportion test • Sample proportions: • Test statistic Z = -3.44 • P-value = 2(0.0003) = 0.0006 • Since P-value < our  of 0.01, we reject H0.

  29. Conclusion to the proportion test • We have evidence the proportion of yellow M&Ms is not the same as the proportion of yellow Skittles. • In other words, the type of candy makes a difference to the color distribution.

  30. How do our results from the 2 tests compare? • The X2 test statistic = 11.839, which is actually the (Z test statistic = -3.44)2. • If you take into account the rounding, the P-values for both tests are  0.001. • We rejected H0 in both tests.

  31. When do you use which test? • Chi-squared tests are best for: two-sided hypothesis tests only 2x2 or bigger tables • Proportion (Z) tests are best for: one- or two-sided hypothesis tests only 2x2 tables

More Related