Survival on the Titanic

Eashani Deorukhkar
28 December 2017

About:

  • final assignment for the course “Developing Data Products” of Coursera's Data Science Specialization.

  • uses linear regression to predict how likely various factors like age, sex, class, port of embarkation and number of siblings were responsible for the survival of passengers aboard the Titanic.

Components:

  • made with RShiny.
  • It has 2 main files, ui.R and server.R.
  1. ui.R : This file faces the user and is responsible for collecting input and displaying the output
  2. server.R : This file is responsible for the calculations based on the inputs and sending the outputs to ui.R

Working:

  • ui.R has a group of radio buttons for input.
  • The user chooses one button from them. Each option corresponds to a predictor from the list of predictors (age, sex, class, port of embarkation and number of siblings).
  • This data is passed to server.R where linear regression is performed with survival as the response vector and the predictor as specified by the user.
  • The results of the lm function are displayed as output.

Example:

The following code example shows regression where survival is the response and Age is the predictor

         term     estimate  std.error statistic      p.value
1 (Intercept)  0.483752625 0.04178795 11.576367 1.619100e-28
2         Age -0.002612541 0.00126412 -2.066687 3.912465e-02