mandms                package:UsingR                R Documentation

_P_r_o_p_o_r_t_i_o_n_s _o_f _c_o_l_o_r_s _i_n _v_a_r_i_o_u_s _M _a_n_d _M'_s _v_a_r_i_e_t_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     A bag of the candy M and M's has many different colors. Each large
     production batch is blended to the ratios given in this data set.
     The batches are thoroughly mixed and then the individual packages
     are filled by weight using high-speed equipment, not by count.

_U_s_a_g_e:

     data(mandms)

_F_o_r_m_a_t:

     A data frame with 5 observations on the following 6 variables.

     _b_l_u_e percentage of blue

     _b_r_o_w_n percentage of brown

     _g_r_e_e_n percentage of green

     _o_r_a_n_g_e percentage of orange

     _r_e_d percentage of red

     _y_e_l_l_o_w percentage of yellow

_S_o_u_r_c_e:

     This data is attributed to an email sent by Masterfoods USA, A
     Mars, Incoporated Company. This email was archived at the Math
     Forum, <URL: http://www.mathforum.org>.

_E_x_a_m_p_l_e_s:

     data(mandms)
     bagfull = c(15,34,7,19,29,24)
     names(bagfull) = c("blue","brown","green","orange","red","yellow")
     prop = function(x) x/sum(x)
     chisq.test(bagfull,p = prop(mandms["milk chocolate",]))
     chisq.test(bagfull,p = prop(mandms["Peanut",]))

