This is an R Markdown document. This document contains a detailed analysis of the titanic sinking episode.
Reading the titanic data set into R:
titanic.df <- read.csv(paste("Titanic Data.csv",sep=""))
View(titanic.df)
## [1] 889
##
## 0 1
## 549 340
##
## 0 1
## 0.6175478 0.3824522
## Survived
## Pclass 0 1
## 1 80 134
## 2 97 87
## 3 372 119
## Survived
## Pclass 0 1
## 1 8.998875 15.073116
## 2 10.911136 9.786277
## 3 41.844769 13.385827
## , , Pclass = 1
##
## Survived
## Sex 0 1
## female 3 89
## male 77 45
##
## , , Pclass = 2
##
## Survived
## Sex 0 1
## female 6 70
## male 91 17
##
## , , Pclass = 3
##
## Survived
## Sex 0 1
## female 72 72
## male 300 47
## Survived
## Sex 0 1
## female 14.75410 67.94118
## male 85.24590 32.05882
## Survived
## Sex 0 1
## female 25.96154 74.03846
## male 81.10919 18.89081
The proportion of females onboard who survived the sinking of the Titanic was higher than the proportion of males onboard who survived the sinking of the Titanic.
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: mytable
## X-squared = 258.43, df = 1, p-value < 2.2e-16
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.