Two-way frequency tables

    Understanding Two-Way Frequency Tables

    A two-way frequency table (also known as a contingency table) is a powerful tool used in statistics to display the frequencies or relative frequencies for two categorical variables. It organizes data in rows and columns, where each cell in the table shows the count of observations that fall into a particular combination of categories for the two variables.

    Structure of a Two-Way Table

    • Rows and Columns: One categorical variable defines the rows, and the other defines the columns.
    • Cells: The entries within the table's body represent the joint frequencies, which are the counts of observations sharing specific categories from both variables.
    • Marginal Frequencies: These are the totals for each row and each column, found in the margins of the table. They represent the frequency distribution of each variable individually. The sum of all row marginal frequencies (or column marginal frequencies) equals the grand total, which is the total number of observations.

    Types of Frequencies

    • Joint Frequencies: As mentioned, these are the counts in the interior cells of the table. For example, if we're looking at gender and political affiliation, the number of 'Females' who are 'Republican' would be a joint frequency.
    • Marginal Frequencies: These are the totals for each category of a single variable, located in the margins. For instance, the total number of 'Males' or the total number of 'Democrats'.
    • Conditional Frequencies: These are frequencies for one variable, given a specific category of the other variable. They are calculated by dividing a joint frequency by a relevant marginal frequency. For example, the proportion of 'Democrats' who are 'Male' (calculated as Joint Frequency (Male and Democrat) / Marginal Frequency (Democrat)).

    Calculating Relative Frequencies

    Two-way tables can also display relative frequencies, which are proportions or percentages. These can be calculated in a few ways:

    • Overall Relative Frequencies: Each cell frequency is divided by the grand total. This tells you the proportion of the entire dataset that falls into that specific combination of categories. For example, if 10 out of 100 people are 'Male' and 'Support Candidate A', the overall relative frequency is 0.10.
    • Row Relative Frequencies (Conditional): Each cell frequency is divided by its respective row total. This shows the distribution of the column variable within each category of the row variable. For example, what proportion of 'Males' support 'Candidate A'?
    • Column Relative Frequencies (Conditional): Each cell frequency is divided by its respective column total. This shows the distribution of the row variable within each category of the column variable. For example, what proportion of 'Candidate A' supporters are 'Male'?

    These different types of relative frequencies are crucial for investigating possible associations or relationships between the two categorical variables. For example, if the conditional relative frequencies across rows are significantly different, it suggests an association between the variables.

    Example Scenario

    Consider a study on handedness (left/right) and preferred writing instrument (pen/pencil). A two-way table would show counts like: 'Right-handed pen users', 'Left-handed pencil users', 'Total right-handed', 'Total pencil users', and the 'Grand Total' of all participants. From this, we can calculate various conditional probabilities to see if handedness influences writing instrument choice.

    Practice questions

    1

    What is the primary purpose of a two-way frequency table?

    2

    In a two-way frequency table, how are 'marginal frequencies' calculated?

    3

    What does a 'conditional relative frequency' represent in a two-way table?

    4

    If a two-way table shows identical row relative frequencies across all columns, what does this suggest about the two variables?

    Practice more free →

    Free AP4U account — unlimited practice, AI grader, and progress tracking.

    Canonical: https://apforu.com/ap/statistics/unit-2-exploring-two-variable-data/two-way-frequency-tables