title: “Titanic” titanic <- read.csv(paste(“titanic.csv”, sep=“”)) titanic View(titanic) tail(titanic) #total 889 passengers mytable<- table(titanic$Survived) mytable #340 survived prop.table(mytable)100 #38.24 percent survived mytable<- xtabs(~Survived+Pclass, data= titanic) mytable #134 passengers from 1 class survived prop.table(mytable,2)100 #62.61 percent of 1class passenger survived mytable<- xtabs(~Survived+Pclass+Sex, data= titanic) mytable #89 females from 1st class survived mytable<- xtabs(~Survived+Sex, data= titanic) mytable prop.table(mytable,1)100 #67.94 percent of survivers were females prop.table(mytable,2)100 #74.03 percent of females survived output: html_document —