setwd("C:/Users/saihe/Documents")
Dilem.df<-read.csv(paste("Data - Deans Dilemma.csv", sep=""))
View(Dilem.df)
placed <-Dilem.df[ which(Dilem.df$Placement == "Placed"),]
aggregate(placed$Salary, by=list(Gender=placed$Gender), mean)
## Gender x
## 1 F 253068.0
## 2 M 284241.9
Therefore, the average salary of males was 284241.9 and that of females was 253068.0 who were placed.
Null Hypothesis is “There is no significant difference between average salaries of male and female MBA graduates.”
t.test(Salary ~ Gender, data=placed)
##
## Welch Two Sample t-test
##
## data: Salary by Gender
## t = -3.0757, df = 243.03, p-value = 0.00234
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -51138.42 -11209.22
## sample estimates:
## mean in group F mean in group M
## 253068.0 284241.9
p-value is 0.00234 < 0.05 which means we reject our null hypothesis. This implies that there is a significant difference between average salaries of males and females.