Task 4a

Reading the dataset for RMS Titanic.

RMS_Titanic <- read.csv("G://IIM Lucknow//Titanic//Titanic Dataset.csv") View(RMS_Titanic)

Task 4b

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)

Task4c t test for the Hypothesis : The Titanic survivors were younger than the passengers who died.

t.test(Age~Survived, var.equal = TRUE, data = RMS_Titanic)

Null Hypothesis rejected

Since p value <0.05,we reject the null hypotesis that the titanic survivors were not younger than the titanic survivors who died.