TASK 3b

Use R to create a table showing the average salary of males and females, who were placed. Review whether there is a gender gap in the data. In other words, observe whether the average salaries of males is higher than the average salaries of females in this dataset.

DDstudy.df<-read.csv(paste("Data - Deans Dilemma.csv", sep=""))
placed.df<- DDstudy.df[which(DDstudy.df$Placement=='Placed'),]
attach(placed.df)
gender_salary<-aggregate(Salary, by=list(Gender=Gender), mean)
gender_salary
##   Gender        x
## 1      F 253068.0
## 2      M 284241.9

TASK 3c

Use R to run a t-test to test the following hypothesis: H1: The average salary of the male MBAs is higher than the average salary of female MBAs.

t.test(Salary~Gender)
## 
##  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

Based on the output of the t test, we can reject the null hypothesis that salary is independent of gender (since p<0.05). And this leads to the inferrence that the average salary of the male MBAs is higher than the average salary of female MBAs.