Question

In: Statistics and Probability

Q.N. 7) According to the manufacturer of M& Ms, 12% of the peanut M&Ms in a...

Q.N. 7) According to the manufacturer of M& Ms, 12% of the peanut M&Ms in a bag should be brown, 15% yellow, 12% red, 23% blue, 23% orange, and 15% green. A student randomly selected a bag of peanut M&Ms. He counted the number of M&Ms that were each color and obtained the results shown in the table below. Test whether peanut M&Ms follow the distribution stated by M&M/Mars at the α = 0.05 level of significance.

Color Frequency
Brown 53
Yellow 66
Red 38
Blue 96
Orange 88
Green 59

Use R to solve and show R code

Solutions

Expert Solution

We know that given frequencies are known as observed frequencies.

Hence, total of frequency = N = 400.

Given that, probabilities of the color peanut.

Now we obtain expected frequency = (probabilities*observed frequency)

Now the hypothesis is,

H0 : Peanut M&Ms follow the distribution stated by M&M/Mars

vs H1 : peanut M&Ms does not follow the distribution stated by M&M/Mars

If Oi = observed frequency and ei = expected frequency then the test statistic for testing above hypothesis is

Hence R code for the above problem is

R-code:

o=c(53,66,38,96,88,59) ## o = Observed Frequency

N=sum(o) ## N = Total Frequency

pr=c(0.12,0.15,0.12,0.23,0.23,0.15) ## pr = Given probabilities

e=N*pr ## e = Expected Frequency

chisq.test(x=o,p=pr) ## chisquare test for goodness of fit

## Now manual calculations

chi_test=sum(((o-e)^2)/e) ## chisquare test statistic

pvalue=pchisq(chi_test,df=5,lower.tail=FALSE) ## pvalue for test

print(c(chi_test,pvalue))

R code with output:

> o=c(53,66,38,96,88,59) ## o = Observed Frequency
> N=sum(o) ## N = Total Frequency
> pr=c(0.12,0.15,0.12,0.23,0.23,0.15) ## pr = Given probabilities
> e=N*pr ## e = Expected Frequency
> chisq.test(x=o,p=pr) ## chisquare test for goodness of fit

# Output : Chi-squared test for given probabilities

data: o
X-squared = 3.5687, df = 5, p-value = 0.613

> ## Now manual calculations
>
> chi_test=sum(((o-e)^2)/e) ## chisquare test statistic
> pvalue=pchisq(chi_test,df=5,lower.tail=FALSE) ## pvalue for test
> print(c(chi_test,pvalue))

# Output:
[1] 3.568659 0.613025

From the above output, we get

Chi-square test statistic = 3.5687

p-value = 0.613

Let level of significance = 0.05

Since p-value = 0.613 > level of significance = 0.05, hence we cannot reject the null hypothesis H0 at 5% level of significance and conclude that peanut M&Ms follow the distribution stated by M&M/Mars at 5% level of significance.


Related Solutions

According to Masterfoods, the company that manufactures M&Ms, 12% of peanut M&Ms are brown, 15% are...
According to Masterfoods, the company that manufactures M&Ms, 12% of peanut M&Ms are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. Assume that selecting multiple M&Ms are independent events. (Round your answers to three decimal places, for example: 0.123) Compute the probability that a randomly selected peanut M&M is not yellow. A: Compute the probability that four randomly selected peanut M&Ms are all yellow. A: If you randomly select five peanut...
According to the manufacturer of M&Ms, 13% of the plain M&Ms in a bag should be...
According to the manufacturer of M&Ms, 13% of the plain M&Ms in a bag should be brown, 14% should be yellow, 13% should be red, 24% should be blue, 20% should be orange, and 16% should be green. A student randomly selected a bag of plain M&Ms. he counted the number of M&Ms that were each color and obtained the results shown in the table. Test whether plain M&Ms follow the distribution stated by M&M at the level of significance=0.05....
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select five peanut M&M’s from an extra-large bag of the candies. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) Compute the probability that exactly four of the five M&M’s are blue. Compute the probability that three or...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select six peanut M&M’s from an extra-large bag of the candies. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) Compute the probability that exactly two of the six M&M’s are red Compute the probability that two or...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select peanut M&M’s from an extra-large bag looking for a orange candy. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) Compute the probability that the first orange candy is the third M&M selected.    Compute the probability...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select four peanut M&M’s from an extra-large bag of the candies. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) A. Compute the probability that exactly two of the four M&M’s are brown. B. Compute the probability that...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select five peanut M&M’s from an extra-large bag of the candies. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) Compute the probability that exactly four of the five M&M’s are orange. Compute the probability that three or...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select five peanut M&M’s from an extra-large bag of the candies. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) Compute the probability that exactly three of the five M&M’s are blue. Compute the probability that three or...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. You randomly select five peanut M&M’s from an extra-large bag of the candies. (Round all probabilities below to four decimal places; i.e. your answer should look like 0.1234, not 0.1234444 or 12.34%.) Compute the probability that exactly three of the five M&M’s are blue. Compute the probability that three or...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are...
According to Masterfoods, the company that manufactures M&M’s, 12% of peanut M&M’s are brown, 15% are yellow, 12% are red, 23% are blue, 23% are orange and 15% are green. (Round your answers to 4 decimal places where possible) a. Compute the probability that a randomly selected peanut M&M is not red. b. Compute the probability that a randomly selected peanut M&M is yellow or orange. c. Compute the probability that three randomly selected peanut M&M’s are all orange. d....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT