Predicting Survival on the Titanic

Sean Angioilllo
10 Jan 2018

Women and Children First?

We have all heard of a policy of “Women and children first” on the sinking titanic. A dataset provided by Kaggle will help us explore the extent to which this policy dictated survival.

  • The visualization on the next slide gives a glimpse of how survival likelihood differed by factors like age, sex and passenger class.
  • My Shiny App uses a simple logistic regression model to predict a passenger's probability of survival based on demographic factors the user chooses.

Survival Plotted by Age, Class, and Sex

plot of chunk unnamed-chunk-2

Logistic Regression Model

Below is the formula our model uses to predict the probability of a passenger's survival.

form <- formula(Survived ~ Pclass + Age + Sex + FamilySize + Fare)
mod <- glm(form, data = training, family = "binomial")

Try It Out For Yourself

  • The Shiny app can be found here.
  • The code can be found on GitHub here.