R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

titanic <- read.csv("Titanic Data.csv")
View(titanic)

Including Plots

You can also embed plots, for example:

aggregate(titanic$Age,by=list(titanic$Survived),mean)
##   Group.1        x
## 1       0 30.41530
## 2       1 28.42382
boxplot(Age~Survived,data = titanic)

t.test(Age~Survived,var.equal=TRUE,data = titanic)
## 
##  Two Sample t-test
## 
## data:  Age by Survived
## t = 2.2302, df = 887, p-value = 0.02599
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.238890 3.744064
## sample estimates:
## mean in group 0 mean in group 1 
##        30.41530        28.42382

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