placed <- dean.df[which(dean.df$Placement_B ==1),]
Table showing the average salary of males and females who were placed
aggregate(Salary~Gender,data = placed,mean)
## Gender Salary
## 1 F 253068.0
## 2 M 284241.9
T-Test to test the hypothesis Hypothesis : The average salary of the male MBAs is higher than the average salary of female MBAs.
t.test(placed$Salary~placed$Gender,var.equal = TRUE)
##
## Two Sample t-test
##
## data: placed$Salary by placed$Gender
## t = -2.7597, df = 310, p-value = 0.00613
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -53400.627 -8947.012
## sample estimates:
## mean in group F mean in group M
## 253068.0 284241.9
The p-value is 0.00613
Since p<0.01 , the hypothesis is true.Therefore,the average salary of the male MBAs is higher than the average salary of female MBAs.