1. The mean salary of males and females, who were placed.
placed <- dean1.df[which(dean1.df$Placement_B=="1"),]
View(placed)
aggregate(placed$Salary, by=list(placed$Gender),mean)
## Group.1 x
## 1 F 253068.0
## 2 M 284241.9
2. The average salary of male MBAs who were placed.
placed1 <- placed[which(placed$Gender.B=="0"),]
View(placed1)
mean(placed1$Salary)
## [1] 284241.9
3. The average salary of female MBAs who were placed.
placed2 <- placed[which(placed$Gender.B=="1"),]
View(placed2)
mean(placed2$Salary)
## [1] 253068
4. t-test for the Hypothesis “The average salary of the male MBAs is higher than the average salary of female MBAs.
t.test(dean1.df$Salary~ dean1.df$Gender,var.equal=TRUE)
##
## Two Sample t-test
##
## data: dean1.df$Salary by dean1.df$Gender
## t = -2.5757, df = 389, p-value = 0.01037
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -67352.803 -9040.516
## sample estimates:
## mean in group F mean in group M
## 193288.2 231484.8
5. The p=value is= 0.01037
6. Since the p-value is less than 0.05, hence we reject the null hypothesis. Hence, we accept the alternative hypothesis, that the average salary of the male MBAs is higher than the average salary of female MBAs. Therefore, the average salary of the male MBAs is higher than the average salary of female MBAs.