Lesson 6 Study Guide: Relationships Between Categorical Variables
Introduction to Analyzing Categorical Variables
Lesson 6 focuses on the relationship between categorical variables, specifically how to analyze them visually and numerically to determine if a relationship exists.
The primary tools discussed include organizing data into tables, calculating probabilities (risk and odds), and understanding the cautions involved in interpreting these statistics.
This lesson moves away from measurement variables to explore how data categories interact.
Analyzing Categorical Data: The Two-Way Table
Definition of a Two-Way Table: A summary table where each cell contains the count (frequency) of cases that fall into both a specific row category and a specific column category.
Example: Binge-Watching Survey:
Organization: YouGov.
Data Source: A 2022 survey of U.S. adults regarding TV viewing habits.
Research Question: Is there a relationship between binge-watching frequency and geographical census regions in the U.S.?
Variables: There are exactly two variables shown in this analysis:
Binge-watching frequency (e.g., Always, Never).
Geographical region (Northeast, Midwest, South, West).
Sample Size: While adults were surveyed, only provided responses to this specific question, making the grand total for the table.
Reading and Testing Knowledge of Two-Way Tables
Summarized vs. Raw Data: Two-way tables contain summarized data (totals/counts), not raw individual data points.
Navigating Rows and Columns:
To find the total who reported "Never" binge-watching, look at the end of that specific row (Total = ).
To compare specific regions for the "Always" category, look across the row: there were more "Always" responses from the South than from the West.
Total respondents from the Northeast reached (found at the bottom of the column).
The "Always" category totaled out of , making the statement that it was the "most selected" false.
Calculating Proportions and Conditional Proportions
Proportion of Total Sample:
Proportion who always binge-watch: or approximately .
Combined Proportions:
Proportion from the South () or the West (): or .
Conditional Proportions:
These limit the denominator to a specific subgroup (a "double conditional").
Proportion of Northeast residents who always binge-watch:
Number who always watch in the Northeast = .
Total in the Northeast = .
Calculation: or .
Visualizing Categorical Relationships
Side-by-Side Bar Charts: Used to compare categories across different groups (e.g., region vs. binge frequency).
Segmented Bar Charts: A single bar represents a whole group (like a region), and different colors within that bar represent the frequency levels of binge-watching, stacking them to show total proportions.
Quantitative Methods: Risk and Odds
In research studies, particularly randomized comparative experiments, groups are often divided into treatment and placebo to measure differences.
Risk:
Formula: .
Example: In a set of 5 items where 2 are positive, the risk is .
Odds:
Formula: .
Example: In a set of 5 items where 2 are positive and 3 are negative, the odds are to , or .
Note: Odds can result in improper fractions (values greater than 1), unlike risk.
Relative Risk (RR) and Odds Ratios (OR)
Relative Risk (RR):
Formula: .
Interpretation:
: The risk is identical for both groups.
: The first group is 3 times more likely to have the outcome than the second.
Increased Risk: If , the increased risk is (calculated as ).
Odds Ratio (OR):
Formula: .
Interpretation:
: The odds are the same for both groups.
: The odds for the first group are 3 times the odds of the second group.
Case Study: Rosiglitazone for Type 2 Diabetes
Study Goal: Evaluating the success of glycemic control in youth with Type 2 diabetes using three treatments ( participants randomly assigned).
Explanatory Variables (3 Groups):
Metformin: Known drug alone ( total).
ROSI: Metformin plus Rosiglitazone ( total; successes, failures).
Lifestyle: Metformin plus weight loss/exercise program ( total; successes, failures).
Response Variable: Glycemic control (Success vs. Failure).
Calculations for the ROSI Group:
Risk of Success: .
Odds of Success: .
Relative Risk Calculation (ROSI vs. Lifestyle):
.
Interpretation: Patients using rosiglitazone had a times greater risk of success, or a increased risk of success compared to the lifestyle group.
Odds Ratio Calculation (ROSI vs. Metformin Alone):
Odds for ROSI = .
Odds for Metformin = .
.
Interpretation: The odds of success for ROSI patients are approximately times the odds for those on metformin alone.
Cautions and Interpretations of Risk
Baseline Risk: It is crucial to know the starting risk level. A reported "5 times higher risk" could mean an increase from per to per . While significant, the absolute risk remains very low.
Protective Effect: A relative risk less than 1 (e.g., RR < 1.0) indicates that the factor being studied provides a protective effect, lowering the risk below the baseline.
Specificity: Risk is rarely universal. It is usually conditional on factors like age, sex, health history, and behavior.
Example: Men over 50 have times the risk of sudden cardiac events during marathons compared to women under 40. This risk does not apply equally to a 22-year-old woman.
Relative Risk vs. Baseline Risk:
Relative risk answers: "Compared to what?"
Baseline risk answers: "How big is the problem in the first place?"
Identifying Statistical Statements
Relative Risk: "Participants taking ROSI were times as likely to maintain control."
Odds: "17 reported always binge-watching, while 159 did not."
Odds Ratio: "The odds of reporting 'always' among Northeast respondents were times the odds among respondents from the Midwest."
Risk: "Across all respondents, reported always binge-watching."
Simpson’s Paradox
Definition: An observed association between two variables that changes or reverses direction when a third confounding variable is introduced that interacts strongly with both.
Speed Limit Example:
In a scatterplot of speed vs. accident rates, the overall trend might appear negative (as speed limits increase, injuries go down).
However, when looking within individual speed limit groups (e.g., ), the trend in each group is positive (higher average speed within that limit leads to more injuries).
Restaurant Recommendation Example:
Carlos' restaurant may have a higher recommendation percentage among males and a higher percentage among females individually.
Yet, when the data is merged, Sophia's restaurant might have a higher overall percentage due to differences in sample sizes within the gender subgroups (e.g., vs. ).
Prevention: To avoid Simpson's Paradox, researchers must identify potential confounding variables during the study design phase and analyze data within subgroups rather than just in aggregate.