In: Math
Suppose that M&M claims that each bag of Peanut M&Ms should be 18 grams and Plain M&Ms should be 13.5 grams.
a. Test the claim that M&M is shorting its customers in bags of Plain M&Ms.
b. Test the claim that M&M is overfilling Peanut bag bags of M&Ms.
c. Discuss your choice of ?.
i. Why did you choose the ? you did?
ii. If you had chosen a different ?, would it have affected your conclusion?
Total Plain M&Ms: 665
Total Peanut M&Ms: 356
Sum Total Weight of All the Bags of Peanut M&Ms: 921 grams
(18g, 21g, 19g, 17g, 18g, 21g, 18g, 18g, 21g, 17g, 19g, 16g, 20g, 20g, 17g, 17g, 18g, 16g, 20g, 18g, 19g, 20g, 20g, 18g, 21g, 19g, 17g, 18g, 17g, 19g, 16g, 19g, 19g, 19g, 17g, 20g, 18g, 18g, 17g, 19g, 19g, 18g, 18g, 18g, 17g, 17g, 19g, 20g, 18g, 18g)
Sum Total Weight of All the Bags of Plain M&Ms: 601 grams
(13g, 13g, 12g, 14g, 14g, 14g, 13g, 13g, 12g, 12g, 13g, 13g, 13g, 14g, 13g, 14g, 12g, 11g, 12g, 12g, 13g, 10g, 15g, 14g, 16g, 14g, 15g, 13g, 12g, 13g, 14g, 13g, 13g, 13g, 11g, 12g, 12g, 14g, 13g, 13g, 14g, 14g, 12g, 13g, 13g, 15g)
a. Test the claim that M&M is shorting its customers in bags of Plain M&Ms.
> Plain=c(13, 13, 12, 14, 14, 14, 13, 13, 12, 12, 13, 13, 13, 14, 13, 14, 12, 11, 12, 12, 13, 10, 15, 14, 16, 14, 15, 13, 12, 13, 14, 13, 13, 13, 11, 12, 12, 14, 13, 13, 14, 14, 12, 13, 13, 15) > t.test(Plain,alternative="less",mu=13.5,conf.level = 0.95) One Sample t-test data: Plain t = -2.5796, df = 45, p-value = 0.006614 alternative hypothesis: true mean is less than 13.5 95 percent confidence interval: -Inf 13.34828 sample estimates: mean of x 13.06522
The one-sided 95% confidence interval tells that M&M is shorting its customers in bags of Plain M&Ms.
b. Test the claim that M&M is overfilling Peanut bag bags of M&Ms.
> Peanut=c(18, 21, 19, 17, 18, 21, 18, 18, 21, 17, 19, 16, 20, 20, 17, 17, 18, 16, 20, 18, 19, 20, 20, 18, 21, 19, 17, 18, 17, 19, 16, 19, 19, 19, 17, 20, 18, 18, 17, 19, 19, 18, 18, 18, 17, 17, 19, 20, 18, 18) > t.test(Peanut,alternative="greater",mu=18,conf.level = 0.95) One Sample t-test data: Peanut t = 2.2138, df = 49, p-value = 0.01576 alternative hypothesis: true mean is greater than 18 95 percent confidence interval: 18.10193 Inf sample estimates: mean of x 18.42
The one-sided 95% confidence interval tells that M&M is overfilling Peanut bag bags of M&Ms of 18g.
c. Discuss your choice of ?.
i) level of significance choice is 5%. Reducing the alpha level from 0.05 to 0.01 reduces the chance of a false positive (called a Type I error) but it also makes it harder to detect differences with a t-test. in this case us ?.=0.05.
ii)
> Plain=c(13, 13, 12, 14, 14, 14, 13, 13, 12, 12, 13, 13, 13, 14, 13, 14, 12, 11, 12, 12, 13, 10, 15, 14, 16, 14, 15, 13, 12, 13, 14, 13, 13, 13, 11, 12, 12, 14, 13, 13, 14, 14, 12, 13, 13, 15) > t.test(Plain,alternative="less",mu=13.5,conf.level = 0.99) One Sample t-test data: Plain t = -2.5796, df = 45, p-value = 0.006614 alternative hypothesis: true mean is less than 13.5 99 percent confidence interval: -Inf 13.47177 sample estimates: mean of x 13.06522 > Peanut=c(18, 21, 19, 17, 18, 21, 18, 18, 21, 17, 19, 16, 20, 20, 17, 17, 18, 16, 20, 18, 19, 20, 20, 18, 21, 19, 17, 18, 17, 19, 16, 19, 19, 19, 17, 20, 18, 18, 17, 19, 19, 18, 18, 18, 17, 17, 19, 20, 18, 18) > t.test(Peanut,alternative="greater",mu=18,conf.level = 0.99) One Sample t-test data: Peanut t = 2.2138, df = 49, p-value = 0.01576 alternative hypothesis: true mean is greater than 18 99 percent confidence interval: 17.96376 Inf sample estimates: mean of x 18.42
If we choose different ? at 1% then the conclusion should be same.