Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
Students are often considered to be large consumers of snacks due to the presence of
vending machines at schools. This raises an interesting question: do women crave more
for sweet or salty products compared to men? The present paper tries to answer this
question.
Test Used
The gender and the type product consumed (chocolate and chips) are both qualitative
variables. In this case, the most appropriate test is the Chi-Square test for Independence.
This version of the test is not covered in the lectures. Briefly, this test is specially
designed to quantify the association between two qualitative variables. Here are the two
hypotheses:
H0: There is no association between the gender and the type of product consumed.
H1: There is an association between the gender and the type of product consumed.
To test H0, we compare observed counts with expected counts (expected if H0 is true) and
if observed counts are far enough from expected counts, we reject H0.
The χ2 statistic is based on a sum of differences between observed and expected counts,
one for each cell of table 1. For example, 41 women bought a chocolate product. The
expected count for this cell is
Total of people consuming a chocolate product × total of women 74 × 50
= = 37
Total number of people 100
Results
Table 2, shows the expected values for all the cells.
We can now find the value of the χ2 statistic, adding the 4 differences between observed
and expected counts.
The observed value of χ2 measures how far the observed counts are from the counts that
would be expected if H0 were true. To know if χ2obs = 3.32 is large enough to reject H0,
this value is to compared against the sampling distribution of χ2 if H0 was true.
There are 2 genders and 2 outcomes (sweet or salty). That is r =2, and c = 2. The χ2
statistic therefore has degree of freedom
(r-1)(c-1) = (2-1) (2-1) = (1) (1) = 1
By looking at the χ table, we see that χ2 = 3.32 is smaller than the critical value of 3.84 at
2
α = 0.05. Because we do not reject H0, this study shows that men and women do not
consume different types of snacks.
Same analysis with SAS
SAS codes
data snacks;
input gender$ product$ number;
cards;
Women Sweet 41
Women Salty 9
Men Sweet 33
Men Salty 17
;
proc freq data = snacks;
weight number;
table gender*product/chisq measure;
run;
The FREQ Procedure
Table of gender by product
gender product
Frequency|
Percent |
Row Pct |
Col Pct |Salty |Sweet | Total
_________|________|________|_______
Men | 17 | 33 | 50
| 17.00 | 33.00 | 50.00
| 34.00 | 66.00 |
| 65.38 | 44.59 |
_________|________|________|
Women | 9 | 41 | 50
| 9.00 | 41.00 | 50.00
| 18.00 | 82.00 |
| 34.62 | 55.41 |
_________|________|________|
Total 26 74 100
26.00 74.00 100.00
Conclusion
By statistical analysis, it was found that there is no significant difference in men’s or
women’s preference for snack food type.