Categorical Data Analysis and Contingency Tables
Contingency Tables and Categorical Organization
Contingency tables are used to organize categorical data by counting how many individuals fall into specific categories. This method allows researchers to compare groups and observe relationships, determining how one variable is contingent upon another. For example, a dataset might track exam performance with categories such as below average, average, above average, or high performance against daily caffeine consumption levels including no caffeine, low, moderate, high, or very high. In the provided example, the total counts for exam performance were for below average, for average, for above average, and for high performance. For caffeine consumption, totals showed students consumed no caffeine and students consumed a very high amount.
Proportions, Relative Frequencies, and Percentages
Proportions measure the fraction of a total group, often referred to as relative frequencies because they describe frequency in relation to a total number. In a sample of students, the proportion is calculated by dividing the specific count by the total; for instance, a cell count of results in a proportion of , which is expressed as when converted to a percentage by multiplying by . Contingency tables allow for detailed analysis of these portions, such as looking at the students who consumed a high level of caffeine and finding that of them performed average on the exam, or identifying that students who consumed a high level of caffeine performed above average.
Categorical Comparison and Data Visualization
Visualizations such as bar plots and box and whisker plots facilitate the comparison of categorical groups. A bar plot can reveal that students with very high caffeine consumption are twice as likely to perform below average compared to those with no caffeine. Using the Titanic dataset, proportions of survival can be compared across age groups: approximately (roughly ) of survivors were in the to year old category, while roughly (roughly ) of survivors were in the to year old category. Additionally, box plots provide a way to compare numerical variables like stress levels across categories, showing that the mean stress score for students getting or more hours of sleep () is approximately , whereas students getting or less hours () have a higher mean stress score between and .