Contingency tables are designed to study relationships between two categorical variables or factors. A contingency table has rows and columns labeled with the levels of two factors. The (row
) cell in the table gives the number of observations in the dataset whose value on the first factor is level
and whose value on the second factor is level
. For example, if we have a group of people of both genders, with some smokers and some nonsmokers, we can ask the question, is the percentage of smokers essentially the same for both genders or, equivalently, does the data indicate that there is a significant difference in percentage of smokers?