mba.data <- read.csv("Data - Deans Dilemma.csv")
placed.df <- mba.data[ which(mba.data$Placement_B=='1'),]
aggregate(placed.df$Salary, by=list(placed.df$Gender),mean)
## Group.1 x
## 1 F 253068.0
## 2 M 284241.9
mean_data.df<-aggregate(placed.df$Salary, by=list(placed.df$Gender),mean)
mean_data.df[2,c(2)]
## [1] 284241.9
mean_data.df[1,c(2)]
## [1] 253068
t.test(Salary ~ Gender.B,data=placed.df)
##
## Welch Two Sample t-test
##
## data: Salary by Gender.B
## 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:
## 11209.22 51138.42
## sample estimates:
## mean in group 0 mean in group 1
## 284241.9 253068.0
p-value=0.00234
p-value generated is <0.05, thus we reject the null hypothesis that says there’s no significantdifference between the average salaries, however at the same time we cannot reject our test hypothesis as p-value<0.05