Titanic One Variable - Passenger Class

One variable that I was interested in learning about is the different passenger classes. There were three separate passenger classes - 1st, 2nd, and 3rd. I also wanted to analyze the number of passengers within each class.

Zooming in on Passenger class and survival

In addition to the amount of people in each passenger class, I wanted to analyze the survival rates of among the classes. I wanted to see if being in a higher passenger class, such as 1st class, increased your likelihood of surviving.

## 
##   0   1 
## 549 342
## train$Pclass: 1
##    Mode   FALSE    TRUE 
## logical      80     136 
## ------------------------------------------------------------ 
## train$Pclass: 2
##    Mode   FALSE    TRUE 
## logical      97      87 
## ------------------------------------------------------------ 
## train$Pclass: 3
##    Mode   FALSE    TRUE 
## logical     372     119

After the analysis, I have learned that the most survivors were from 1st class with 136 survivors. I found it interesting that there were more survivors from 3rd class in comparison to 2nd class. Knowing that women and children were given priority for the passenger boats, it makes me wonder if a majority of the 3rd class passengers were women and children, whom probably paid for cheaper tickets.