Reading the dataset for RMS Titanic.
RMS_Titanic <- read.csv("G://IIM Lucknow//Titanic//Titanic Dataset.csv") View(RMS_Titanic)
survival <- aggregate(RMS_Titanic$Age, by = list(RMS_Titanic$Survived), FUN = mean)
Box Plot for the age and survival data
boxplot(Age~Survived, data = RMS_Titanic)
t.test(Age~Survived, var.equal = TRUE, data = RMS_Titanic)
Since p value <0.05,we reject the null hypotesis that the titanic survivors were not younger than the titanic survivors who died.