Another look at Titanic passenger data using two-way tables

It is well known that among the passengers in Titanic, women and children were more likely to survive. It is also well known that first class passengers were even more likely to survive than passengers in the other classes. We continue the data analysis for two-way tables started in a previous post (A look at Titanic passenger data using two-way tables). The two-way table analysis here is on the categorical variable of passenger class (first, second and third) and survival status (yes and no). The main idea we wish to demonstrate is the statistical idea of a relationship (or association) between two categorical variables. In our example, the variable of passenger class and surviving the sinking of the Titanic are related. See the previous post for a more detailed discussion on the basic terminology.

Data for Titanic passengers are easily found on the Internet (this is the link of the site I use). The following is a two-way table representing the survival status of the passengers in the Titanic by passenger class.

\displaystyle (1) \ \ \ \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&200&117&172&\text{  }&489 \\\text{Survived No}&119&152&527&\text{  }&798 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&319&269&699&\text{  }&1,287 \end{pmatrix}

It is easier to analyze proportions (or percents) than absolute counts and we first convert counts into proportions. The following shows the joint distribution and the marginal distributions.

\displaystyle (2) \ \ \ \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&0.1554&0.0909&0.1336&\text{  }&0.3800 \\\text{Survived No}&0.0925&0.1181&0.4095&\text{  }&0.6200 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&0.2479&0.2090&0.5431&\text{  }&1.0000 \end{pmatrix}

From the total column on the right, we see that 38% of the passengers survived the sinking of the Titanic. From the total row in the bottom, we see that 24.79% of the passengers were in the first class, 20.9% were in the second class and 54.31% were in the third class. Both the total column and the total row are marginal distributions since they are displayed at the margin of the two-way table. Each is a probability of a single variable. The total column is a probability distribution of survival status while the total row at the bottom is a probability distribution of passenger class.

The collection of the proportions in table (2) that are not in the total column and the total row is a joint distribution of the two categorical variables. The joint distribution describes the joint behavior of the two variables and it gives the proportion of the passengers that belong to a combination of passenger class and survival status. For example, the proportion of the passengers who were in first class and survived the sinking is 0.1554 (15.54%).

Even though the joint distribution in table (2) describes the joint behavior of the two variables, it does not help us see the relationship between passenger class and survival status. Table (2) tells us that the proportion of the passengers who were in third class and survived the sinking is 0.1336 (13.36%) while the proportion of the passengers who were in second class and survived the sinking is 0.0909 (9.09%). This does not mean that the third class passengers had a higher survival rate. In fact the opposite was the case.

We need to look at the survival status separately for each passenger class. In other words, we need to look at the proportion of survival within each passenger class. Putting it in another way, we calculate the probability of survival by conditioning on the value of the passenger class.

\displaystyle (3) \ \ \ \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&0.6270&0.4349&0.2461&\text{  }&0.3800 \\\text{Survived No}&0.3730&0.5651&0.7539&\text{  }&0.6200 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&1.0000&1.0000&1.0000&\text{  }&1.0000 \end{pmatrix}

The three columns in table (3) that are labeled First Class, Second Class and Third Class are the conditional distributions of survival status conditional on the value of the passenger class. Now the relationship between passenger class and survival status is clear. We see that 62.7% of the first class passengers survived, while only 24.61% of the third class passengers survived.

We compare the three conditional distribution of survival status conditioning on the value of each of the passenger class. They are obviously different (the higher the class, the survival was more likely). There is a clear relationship between passenger class and survival. Though this may already be a well known fact, the Titanic data example presented here is another excellent demonstration of the data analysis for two-way tables.

We can add to the above analysis by separting the same data for women (combined with children) and men. We then calculate the conditional distributions for these two groups. We have the following pair of two-way tables.

\displaystyle (4a) \text{ Women + Children} \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&143&104&113&\text{  }&360 \\\text{Survived No}&5&13&146&\text{  }&164 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&148&117&259&\text{  }&524 \end{pmatrix}

\displaystyle (4b) \text{ Men} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&57&13&59&\text{  }&129 \\\text{Survived No}&114&139&381&\text{  }&634 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&171&152&440&\text{  }&763 \end{pmatrix}

We now calculate the conditional distributions of survival status (conditioning on passenger class) within each of the gender groups of women plus children and men.

\displaystyle (5a) \text{ Women + Children} \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&0.9662&0.8889&0.4363&\text{  }&0.6870 \\\text{Survived No}&0.0338&0.1111&0.5637&\text{  }&0.3130 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&1.0000&1.0000&1.0000&\text{  }&1.0000 \end{pmatrix}

\displaystyle (5b) \text{ Men} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \begin{pmatrix} \text{ }&\text{First Class}&\text{Second Class}&\text{Third Class}&\text{  }&\text{Total} \\{\text{ }}&\text{ }&\text{ }&\text{ } \\\text{Survived Yes}&0.3333&0.0855&0.1341&\text{  }&0.1691 \\\text{Survived No}&0.6667&0.9145&0.8659&\text{  }&0.8309 \\{\text{ }}&\text{ }&\text{ } \\{\text{Total}}&1.0000&1.0000&1.0000&\text{  }&1.0000 \end{pmatrix}

We make two observations. One is that women and children fared much better than men (a result seen in a previous post). Note the 68.7% survival rate for women and children vs. the 16.91% survival rate for men. The second is that the categorical variable of passenger class made even a bigger difference in survival rates both within the women plus children group and in the comparison between women and men.

Winthin the group of women and children passengers, almost all of the first class passengers survived (about 97%). Even the second class passengers among women and children had a close to 90% survival rate.

On the other hand, men did not fare well in comparison to women and children. Within the first class passengers, only one in three men survived, while the survival rates for men in the second class and third class were very dismal. In the first class passengers, the women and children had a survival rate of close to 97% (vs. 33.33% for men). The differential was even larger for the second class (close to 90% for women and children vs. close to 9% for men). In the third class, the differential was 44% for women and children vs. 13% for men.

Advertisements
This entry was posted in Descriptive statistics, Probability, Statistics and tagged , , , , , , . Bookmark the permalink.

One Response to Another look at Titanic passenger data using two-way tables

  1. Pingback: The Chi-Squared Distribution, Part 3c | Topics in Actuarial Modeling

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s