Categorical Variables, Two-Way Tables, and Proportions: Titanic Survival Case Study

Research Context and Variable Classification

  • Primary Investigation Objective:

    • The study investigates whether a passenger's class of travel served as a predictor of survival status during the sinking of the Titanic.
    • The analytical focus is placed on the relationship between two specific categorical variables: class of travel and survival status.
  • Variable Identification:

    • Explanatory Variable: Class of travel.
    • The categories within the explanatory variable are First Class, Second Class, and Third Class.
    • Standard two-way table design convention specifies that the explanatory variable labels the rows of the contingency table.
    • Response Variable: Survival status.
    • The categories within the response variable are Survived (Yes) and Did Not Survive (No).
    • Standard two-way table design convention specifies that the response variable labels the columns of the contingency table.

Construction and Calculation of the Two-Way Table

  • Summary Data Inputs:

    • First Class: Exactly 200200 passengers survived, and 123123 passengers did not survive.
    • Second Class: There were 277277 total passengers, 57%57\% of whom did not survive.
    • Third Class: A total of 181181 out of 709709 passengers survived.
  • Mathematical Derivations for Cell Frequencies:

    • First Class Totals:
    • Survived (Yes\text{Yes}): 200200
    • Did Not Survive (No\text{No}): 123123
    • Total First Class Passengers: 200+123=323200 + 123 = 323
    • Second Class Cell Values:
    • The proportion of non-survivors is given as 57%57\% of 277277.
    • Set up the proportion formula:       partwhole=%100\frac{\text{part}}{\text{whole}} = \frac{\%}{100}x277=57100\frac{x}{277} = \frac{57}{100}(277)(57)=100(x)(277)(57) = 100(x)15789=100x15789 = 100xx=157.89x = 157.89
    • Because xx represents a discrete count of human passengers, it is rounded to the nearest whole number: x=158x = 158.
    • Calculating the number of survivors in Second Class:       Total−Did Not Survive=277−158=119\text{Total} - \text{Did Not Survive} = 277 - 158 = 119
    • Third Class Cell Values:
    • Survived (Yes\text{Yes}): 181181
    • Total Third Class Passengers: 709709
    • Calculating non-survivors in Third Class:       Total−Survived=709−181=528\text{Total} - \text{Survived} = 709 - 181 = 528
    • Marginal and Grand Totals:
    • Total Survived (Yes\text{Yes}): 200+119+181=500200 + 119 + 181 = 500
    • Total Did Not Survive (No\text{No}): 123+158+528=809123 + 158 + 528 = 809
    • Grand Total of Passengers: 323+277+709=1309323 + 277 + 709 = 1309 (equivalently confirmed by 500+809=1309500 + 809 = 1309).
  • Complete Contingency Table:

    • First Class: 200200 Survived (Yes\text{Yes}), 123123 Did Not Survive (No\text{No}), Total = 323323.
    • Second Class: 119119 Survived (Yes\text{Yes}), 158158 Did Not Survive (No\text{No}), Total = 277277.
    • Third Class: 181181 Survived (Yes\text{Yes}), 528528 Did Not Survive (No\text{No}), Total = 709709.
    • Marginal Column Totals: Total Survived (Yes\text{Yes}) = 500500, Total Did Not Survive (No\text{No}) = 809809, Grand Total = 13091309.

Limitations of Comparing Raw Counts

  • Comparison of Raw Frequencies:

    • When comparing raw survivor counts between Second Class and Third Class passengers, Third Class recorded more survivors in raw numbers (181181 survivors) than Second Class (119119 survivors).
  • Methodological Invalidation of Raw Counts:

    • Raw counts do not provide a meaningful or useful basis for comparison between groups of differing sizes.
    • The total number of passengers in Third Class (709709) was substantially larger than the total number of passengers in Second Class (277277).
    • Because group baselines vary substantially, relative proportions or rates must be calculated to evaluate whether an association exists between passenger class and survival status.

Population Proportions and Group Comparisons

  • Population Parameter Framework:

    • The Titanic data set is treated as an entire population rather than a sample.
    • Consequently, the population parameter symbol PP is utilized for survival proportions rather than the sample statistic symbol p^\hat{p}.
  • Proportion Calculations by Class:

    • First Class Survival Proportion (P1P_1):P1=200323≈0.6191...P_1 = \frac{200}{323} \approx 0.6191...
    • Rounded to three decimal places: P1=0.619P_1 = 0.619 (or 61.9%61.9\%).
    • Second Class Survival Proportion (P2P_2):P2=119277≈0.4296...P_2 = \frac{119}{277} \approx 0.4296...
    • Rounded to three decimal places: P2=0.430P_2 = 0.430 (or 43.0%43.0\%).
    • Third Class Survival Proportion (P3P_3):P3=181709≈0.2552...P_3 = \frac{181}{709} \approx 0.2552...
    • Rounded to three decimal places: P3=0.255P_3 = 0.255 (or 25.5%25.5\%).
  • Proportional Comparison Between Second and Third Class:

    • Comparing the rates reveals that P2=0.430P_2 = 0.430 is significantly higher than P3=0.255P_3 = 0.255.
    • Although Third Class had more survivors in absolute count (181181 vs. 119119), Second Class passengers survived at a substantially higher proportion (43.0%43.0\% vs. 25.5%25.5\%).

Difference of Proportions Analysis

  • Parameter Definitions and Notation:

    • Let P1P_1 represent the proportion of all First Class passengers who survived: P1=0.619P_1 = 0.619.
    • Let P3P_3 represent the proportion of all Third Class passengers who survived: P3=0.255P_3 = 0.255.
    • The direction of subtraction must be clearly specified through subscript notation to define the groups being contrasted.
  • Calculation:P1−P3=0.619−0.255=0.364P_1 - P_3 = 0.619 - 0.255 = 0.364

  • Substantive Interpretation:

    • The difference in survival proportions between First Class and Third Class is 0.3640.364 (or 36.4%36.4\% percentage points).
    • A First Class passenger was 36.4%36.4\% percentage points more likely to survive the sinking than a Third Class passenger.

Visualizing Association: Segmented and Grouped Bar Charts

  • Segmented Bar Chart Characteristics:

    • Displays stacked absolute frequencies representing survival status categories (0=did not survive0 = \text{did not survive}, 1=survived1 = \text{survived}) across the three passenger classes on the horizontal axis.
    • Bar heights reflect the total passenger capacity of each class (323323 in Class 11, 277277 in Class 22, and 709709 in Class 33).
    • Visual inspection illustrates that while Class 33 dominates total passenger volume, the shaded segment denoting survivors (11) constitutes a noticeably smaller fraction of the Third Class column relative to the First Class column.
  • Grouped Bar Chart Characteristics:

    • Places separate bars side-by-side for non-survivors (00) and survivors (11) within each travel class.
    • Class 1: The survivor bar (200200) exceeds the non-survivor bar (123123).
    • Class 2: The non-survivor bar (158158) exceeds the survivor bar (119119).
    • Class 3: The non-survivor bar (528528) vastly exceeds the survivor bar (181181).
  • Evidence of Association:

    • The graphical representations establish a strong association between class of travel and survival status.
    • Survival rates show a consistent, monotonic decline as class rank decreases from First Class (61.9%61.9\%) to Second Class (43.0%43.0\%) to Third Class (25.5%25.5\%).
    • The proportion of survivors was dramatically higher in First Class compared to Third Class, confirming that travel class was a strong predictor of survival.