Part A: Titanic

The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 passengers and crew. This sensational tragedy shocked the international community and led to better safety regulations for ships.

One of the reasons that the shipwreck led to such loss of life was that there were not enough lifeboats for the passengers and crew. Although there was some element of luck involved in surviving the sinking, some groups of people were more likely to survive than others, such as women, children, and the upper-class.

We want to see some light and determining who survived or perished in the Titanic accident throughout Descriptive Statistics Tools

Before starting:

  • How many rows does the file contain?

This table have 1309 rows

  • How many variable does the file contain?

He have 14 variable

  • Can you explain what these variables mean?

Each variable is a column of the table titanic3. Column1:pclass Column2:survived Column3:name Column4:sex Column5:age Column6:sibsp Column7:parch Column8:ticket Column9:fare Column10:cabin Column11:embarked Column12:boat Column13:body Column14:home.dest

  • What should be the data type for each column?

Column1:number of pclass 1 to 3 (numeric) Column2: if he/she survived; 0 desn’t survived, 1 survived (numeric) Column3:name of passenger (character) Column4:sex of passenger (character) Column5:numèric age of passenger Column6:integrer of sibsp Column7:integrer of parch Column8:character of ticket Column9:numeric fare Column10:character which his cabin Column11:factor of embarked Column12:numeric boat Column13:numeric body Column14:adress of home.dest

  • How many passangers were there according to their gender?
table(df$sex)
## 
##        female   male 
##      1    466    843

Si contem quantes dones hi surten en la taula podem veure que hi ha 466. Si ho fem per els homes en surten 843.

  • What are these percentages? (A+)

Tenint en compte el numero de gent total que hi ha al Titanic podem saber els percentatges de homes i dones. Homes: 843/1309 100 = 64,4% Dones: 466/1309 100 = 35,59%

  • Is there anything weird? (A+)

Hi ha moltes homes perquè en aquella època eren les persones que guanyaven més diners i es van poder permetre el luxe de comprar un tiquet per pujar al Titanic.

  • If we want to get insights about the variable survived, report on that. (A++)
ggplot(df,aes(x=survived, fill=sex))+ geom_bar(color='black')