Read Data
stud.df <- read.csv(paste("DeanDillemma.csv", sep=""))
placed <- stud.df[which(stud.df$Placement_B==1),]
attach(placed)
Average salaries of placed Students by Gender
aggregate(Salary, by=list(Gender=Gender), mean)
## Gender x
## 1 F 253068.0
## 2 M 284241.9
Average Salary of male = 284241.9 , female = 253068.0
Boxplots
boxplot(Salary~ Gender, data=placed, xlab="Salary", ylab="Gender",horizontal=TRUE)
We can see that the mean salary of male is higher than female, thus there is a ‘Gender Gap’.
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.
Since the salaries are independent of each other we run a independent T-test
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
Thus we can safely reject the null hypothesis.
This implies that the average salary of the male MBAs is higher than the average salary of female MBAs.