titanic.df <- read.csv(paste("Titanic Data.csv", sep=""))
View(titanic.df)
table1 <-aggregate(titanic.df$Age ~ titanic.df$Survived, data = titanic.df, mean)
table1
## titanic.df$Survived titanic.df$Age
## 1 0 30.41530
## 2 1 28.42382
log.age = log(titanic.df$Age)
t.test(log.age~titanic.df$Survived, var.equal = TRUE)
##
## Two Sample t-test
##
## data: log.age by titanic.df$Survived
## t = 3.844, df = 887, p-value = 0.0001297
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.09102778 0.28094770
## sample estimates:
## mean in group 0 mean in group 1
## 3.304318 3.118330
P=0.0001
Hypothesis is true