top of page
  • Writer's picturePriyanka Palshetkar

Would YOU have survived the Titanic mishap?

Updated: Jun 20, 2022

A data based approach to understand the survival statistics of the Titanic

Introduction


The sinking of the Titanic is one of the most infamous shipwrecks in history.

On April 15, 1912, during her maiden voyage, the widely considered “unsinkable” RMS Titanic sank after colliding with an iceberg. Unfortunately, there weren’t enough lifeboats for everyone onboard, resulting in the death of 1502 out of 2224 passengers and crew. With much public attention in the aftermath, the disaster has since been the material of many artistic works and a founding material of the disaster film genre.


While there was some element of luck involved in surviving, it seems some groups of people were more likely to survive than others. Today we are going to investigate the Titanic Dataset provided by Kaggle to understand if you would have boarded the Titanic would it have been a happy ending for you?


With this analysis, I wanted to confirm some thoughts I had after I watched the movie Titanic.

  1. In the movie it was shown that women and children were first sent on life boats when the Titanic sunk. I want to confirm whether the data gave the same outcome and that there was a better chance of survival if you were a female or a child.

  2. Similar to the above one, whether there was a better chance of survival if you were from the first class?

  3. What factors contributed most to the survival of passengers on the Titanic?

  4. Would you have survived the Titanic?

 

The Data

The dataset we will be working with today has the data about 891 passengers who boarded the Titanic. Let's take a close look about what we information we have on each of the passengers:

Feature

Description

Key

Survival

Whether the passenger survived or not

1 = Survived, 0 = Died

Pclass

Ticket class

1st, 2nd, 3rd

Age

Age of the passenger

Fare

Ticket fare the passenger paid

Ticket

Ticket number

Name

Name of the passenger

Embarked

​Port where the passenger onboarded the Titanic

C = Cherbourg, Q = Queenstown, S = Southampton

SibSp

Whether the passenger had any sibling/spouse onboard

ParCh

Whether the passenger had parents/children onboard

Cabin

What cabin the passenger was alloted

Sex

Gender of the passenger

Male, Female

Let's start talking to our data :D

 

Part 1a: Was there was a better chance of survival if you were a female?


If we look at our data, we do have the Sex column indicating whether the passenger was a male or a female. Let's try to correlate our Sex column with our Survival column.


We can see that female passengers had a 74% chance of survival and male passengers had a 19% chance of survival. So the data supports what they had shown in the movie.

 


Part 1b: Was there was a better chance of survival if you were a child?


For doing this analysis, we do not have a direct column indicating whether the passenger is a child or not. But we can certainly use our Age column to derive this information. Most times when we try to perform an analysis, we do not have all the data for our perusal. At such times we can create new features from the data we have. These are our derived features.


For our analysis, let us consider that any passenger having Age < 16 years is a child. If we observe this new derived features correlation with our Survived column, we observe the following:


We can see that children had a 59% chance of survival. No wonder our antagonist, Cal Hockley, aka Rose's fiancé, got hold of the girl and quickly found his way through the life-boats. May be he could predict things?!

 


Part 2: Was there was a better chance of survival if you were from First class?


In the movie Titanic, our protagonist Jack Dawson had a stroke of luck (was it really though!?) and won a third class ticket to the RMS Titanic. But what if it had been a ticket to the first class? Would it have helped Jack not only to kindle his love with Rose but also increased his chances to survive the disaster that awaited them?


We can see that the people from 1st class had a 63% chance to survive and people from 3rd class had a 24% chance of survival.


It certainly would have helped Jack if he had gotten a ticket to the first class or even the second class!

 


Part 3: What factors contributed most to the survival of passengers on the Titanic?


For this a heat map between all the features, would give us a clearer picture into what kind of passengers survived the Titanic.




We can clearly conclude, that Sex, Class and Fare the passenger paid for the ticket have a strong correlation with Survival. Here, Class and Fare are indicative of the same thing, hence we can include either of them.


Who would have thought that the port where the passenger embarked on the Titanic would have contributed as well. Surprising, isn't it? And it makes sense that people who were alone, were most likely bachelors and since they were the last ones to be boarded onto the life boats, the survival rate there was less.

 

Part 4: Would you have survived the Titanic?


Based on all the data we have, if we devise a ML model which predicts the survival of a new passenger, would you have survived the Titanic?


Let's summarize who would have survived:

Feature

Survival Chance

Female

74%

Male

19%

Children (age < 16)

59%

Adults (age > 16)

36%

1st class

63%

2nd class

47%

3rd class

24%

Now, would you have survived?!


 

Thanks for reading!


This blogpost was a result of the analysis I did on the Kaggle dataset here.

Please do comment any feedback you have on the same and do share any other interesting analysis you have done.






83 views1 comment

1 Comment


Akash Ninave
Akash Ninave
Oct 11, 2021

Brilliant !


Like
bottom of page